
Announcements
I have a requirement in which I need to filter an array (list of direct reports of user) and the filter query must be dynamic ( there is a SharePoint list with all the parameters which needs to be included/excluded) , I tried developing this , but the dynamic query which I create is of the type string (has “” )so it is failing in the filter array action , it’s not evaluating into Boolean value. How can I solve this issue ? . I can use variables to store the filter field and value but how can I manage the length of the query for ex if I have to filter users based on their specific job titles ( say contractors and managers) , how can I dynamically build a query incorporating both the conditions since the variable can hold only one job title and for adding another I have to create another query and 'AND' it with the first?
Is there a better way of developing dynamic queries to use in the filter array action?
error message - The execution of template action 'Filter_array_2' failed: The result '@and(equals(item()?['accountEnabled'],true),or(if(not(equals(item()?['jobTitle'], null)),not(contains(item()?['jobTitle'], 'Contractor')),true),if(not(equals(item()?['jobTitle'], null)),contains(item()?['jobTitle'], 'engineer'),true)),or(if(not(equals(item()?['country'], null)),contains(item()?['country'], 'India'),true),if(not(equals(item()?['country'], null)),contains(item()?['country'], 'US'),true)))' of the evaluation of 'query' action 'where' expression '@variables('TestQuery')' is not a valid boolean value.