The queryProcessAnalytics is not giving any results.

Hi All,

I am creating a Custom Task report with filters. I have used 'Custom Picker' component to get user input which is saved in local variable and passed to the 'queryProcessAnalytics' query so that the list is dynamically filtered. Not to mention all this goes inside a with() so that the filters are dynamic.

Issue: The queryProcessAnalytics is not giving any results.

Observations:
a) When I run the same 'queryProcessAnalytics' with hard coded values it works. So no error on query logic or syntax
b) When I print the selected value from 'Custom Picker' it shows desired value. So, no null values are passed
c) IF I replace the custom picker with a dropdown , then everything works.
Does the custom picker works in a different way than other components ?

Any pointers to this issue is highly appreciated.

OriginalPostID-189916

OriginalPostID-189916

  Discussion posts and replies are publicly visible

  • @rajatm As you have said that you are working with custom picker, the local variable in this case might have the capacity to store more than one value, i.e. the local variable exhibits the behaviour of an array variable. So it would be worth trying the local variable's value as index(local!customPicker,1,null) while providing the value of local variable to the filter. A similar behavior can also be observed in the variables used for components such as user pickers, user group picker, group picker, multi dropdown etc.

    Added to above, also please try to ensure that index(local!customPicker,1,null) is nothing but the actual value which you see in case of a dropdown. The reason why I am suggesting this is, out of my experience, at times I have seen a space being appended to the actual value at the end.

    An alternative is to use the 'IN' operator when the type of the local variable is array. (i.e. the variable used to save values for components such as custom pickers, user pickers, user group picker, group picker, multi dropdown etc)

    Let's see if any other practitioners can provide much more valuable suggestions. If the issue isn't resolved, I would like to suggest to upload the code snippet or an outline of code snippet.
  • Custom picker will save value as array (One or more variables that are updated with the array of selected identifiers when the user adds or removes an item.), but dropdown will save value as individual type. Hence Index function required to fetch first value from Array to pass to query analytics..
  • @sikhivahans , You were bang on ! What you explained made lot of sense and I tried it straight away and it worked ! Thanks for the help. These tricky things really offers some challenge :)
  • @rajatm No problem, glad to hear that the issue is resolved. :)