Which operator should I use to return certain records based on logged in status?

I am using a!queryProcessAnalytics function to fetch the data from the portal report, and a!queryLogicalExpression function to filter the data, however one of my column say "c9" is having multiple data like list of user, I need only those records from my portal report where "c9" contains logged In user. Which operator I should use?

OriginalPostID-192337

  Discussion posts and replies are publicly visible

Parents
  • @ravir Hi, to the best of my knowledge, here goes the solutions:

    Solution 1:
    Try using the 'includes' operator. I am not sure how far this works, as we are dealing with a string which is result of concatenated array variable. I would like to suggest you to check the accuracy of results by testing the same.

    Solution 2:
    Add a column of Boolean type, in the report. Let's call the newly added column as 'Is logged in user part of list?'. Configure its value like this - If the logged in user is part of user list, then set the value as true, else set it as false. Technically speaking, the column's value should be fn!contains(, fn!loggedInUser()).
    Now when you invoke a!queryProcessAnalytics(), apply the filter on the 'Is logged in user part of list?' column. That is, get only those records from report whose value is true for 'Is logged in user part of list?' and this accomplishes your use-case. Just to let you know, this approach works for sure without any issue.

    Please do let us know in case of any follow up questions.
Reply
  • @ravir Hi, to the best of my knowledge, here goes the solutions:

    Solution 1:
    Try using the 'includes' operator. I am not sure how far this works, as we are dealing with a string which is result of concatenated array variable. I would like to suggest you to check the accuracy of results by testing the same.

    Solution 2:
    Add a column of Boolean type, in the report. Let's call the newly added column as 'Is logged in user part of list?'. Configure its value like this - If the logged in user is part of user list, then set the value as true, else set it as false. Technically speaking, the column's value should be fn!contains(, fn!loggedInUser()).
    Now when you invoke a!queryProcessAnalytics(), apply the filter on the 'Is logged in user part of list?' column. That is, get only those records from report whose value is true for 'Is logged in user part of list?' and this accomplishes your use-case. Just to let you know, this approach works for sure without any issue.

    Please do let us know in case of any follow up questions.
Children
No Data