AnsweredAssumed Answered

GetValuesForQuery - Setting Lookup vs. Choice Form Field

Question asked by MarcB on Nov 20, 2017
Latest reply on Nov 21, 2017 by Matthias_Walter

I have an Action Button that I'm using to set a Form Field value to the "Title" value that I retrieve using the Query below.  When performing the Test in the form, it successfully returns the value I was expecting (in the Test window).  However, in the actual form, the Form Field value is not being set to the correct value. 

 

Note that the Form Field that I'm trying to set is a drop-down (lookup) field that is linked to the same TARGET LIST that I'm doing the query on below.  Also note that I did a very similar Action Button that set a Choice Form Field rather than a Lookup field and that one worked. 

 

var x = [[@Web.GetValuesForQuery("TARGET LIST", "<Query><Where><Eq><FieldRef Name=\"Current_x0020_Release_x0020__x00\" ></FieldRef><Value Type=\"Text\">Current Release</Value></Eq></Where></Query>", "Title", "")]];

 

var varCurrentRelease = x[0];

 

return varCurrentRelease;

Outcomes