Strange behaviour with GetFirstValueForQuery

Discussion created by JelleD on Sep 26, 2019
Latest reply on Oct 3, 2019 by JelleD

Dear Community,


I have a query GetFirstValueForQuery which runs well in "test" mode, while defining the query.
But when triggered in runtime mode it keeps on looping.


Herewith my code/ the query:

var flowID = [[@Web.GetFirstValueForQuery('AuthorisationMatrix','<Where><And><And><And><And><Eq><FieldRef Name="CategoryType"/><Value Type="Choice">[[ReqCategory]]</Value></Eq><Eq><FieldRef Name="RiskType" /><Value Type="Choice">[[RiskType]]</Value> </Eq> </And> <Gt> <FieldRef Name="months_max" /><Value Type="Number">[[TotalMonths]]</Value></Gt></And><Geq><FieldRef Name="amount_max" /><Value Type="Currency">[[TotalAmount]]</Value> </Geq></And><Contains><FieldRef Name="Country" /><Value Type="TaxonomyFieldTypeMulti">[[BusinessUnits.Country]]</Value></Contains></And></Where><OrderBy><FieldRef Name ="FlowSequence" Ascending=True /> </OrderBy>' , 'ID')]];
window.flowID = flowID;



This code is configured in an ExecuteScript Action linked to a Button.

Anyone any idea why query runs well in testmode but not in "runtime"?