AnsweredAssumed Answered

Use Variable within QueryList function in RichForms

Question asked by AtillaÖ on May 7, 2018
Latest reply on May 8, 2018 by Matthias_Walter

Hi Everyone,

i want to use the following expression function : [[@Web.GetFirstValueForQuery('Customers', '<Query><Where><Eq><FieldRef Name="ID" /><Value Type="Text">2</Value></Eq></Where></Query>','Title')]];

with a variable.

Like this:

var varP=2;

[[@Web.GetFirstValueForQuery('Customers', '<Query><Where><Eq><FieldRef Name="ID" /><Value Type="Text">”+varP+”</Value></Eq></Where></Query>','Title')]];

But if I use it like this I get a reference error that the variable “varP” is not defined.

How can I achieve this that it works ?