cancel
Showing results for 
Search instead for 
Did you mean: 

Variables in Query string

cedorfm
Champ in-the-making
Champ in-the-making
Hello,

I am trying to use a variable in my query string. This works fine if I take the literal string from container.id and substitute it. Unfortunately I need this to be dynamic and container.id is going to change relative to the current site. Is it not possible to concatinate like this…

   var container = companyhome.childByNamePath("Sites/" + args.mySite + "/page/News");
   var spath = 'PARENT:"workspace://SpacesStore/"' + container.id;

Thank you for your assistance.
1 REPLY 1

cedorfm
Champ in-the-making
Champ in-the-making
SOLUTION

Looks like my syntax was all wrong…

This is how you include a variable in your string query. I got a little confused using the escape characters.

var spath = "PARENT:\"" + container.nodeRef + "\"";