Hello,
I have create a Process Task Report having as Report Context multiple processes.
I used the a!queryProcessAnalytics to retrieve the data, the only problem is if in column "Assigned to" (tp!assignees) if I have multiple assignments (Group1 and Group2 or Group1 and User1) I won't be able to retrieve the tasks based on the loggedinuser and the groups that is member of (having only one assignee it works.)
logicalexpressions: a!queryLogicalExpression( operator: "OR", filters: a!localVariables( local!groups: getgroupsformemberuser(user: ri!user), { a!forEach( items: local!groups, expression: a!queryFilter( field: "c1", operator: "in", value: fv!item, applywhen: not(rule!APN_isBlank(ri!user)) ) ), a!queryFilter( field: "c1", operator: "in", value: ri!user, applywhen: not(rule!APN_isBlank(ri!user)) ) } ) )
Any ideas how it should be handled or another solution that should be applied?
Discussion posts and replies are publicly visible
Hi there,
Try using this.
logicalExpressions: a!queryLogicalExpression( operator: "OR", filters: a!forEach( items: ri!assignee_txt, expression: a!queryFilter( field: "c4", operator: "includes", value: concat(tostring(fv!item),";"), applyWhen: not(rule!VP_utils_checkIsNull(fv!item)) ), ) )
ri!assignee_txt is List of User or Group
hi I have tried and it doesn't work. :(
Maybe because the output type I configured in my report doesn't match yours. Adding a screenshot below of my report.
I have tried also like this and it doesn't work.
QueryProcessAnalytics does not support logicalExpressions. I solved it by concatenating all users/groups into a single string. The filter with an "includes" operator.
I think it does support that. QueryProcessAnalytics has 'query' property in which we can use logicalExpressions. Also, I have done the same thing in my code. I have concatenated all the values in a single string and I am using logicalExpressions to get tasks for multiple assignees at once.
Hi Stefan! How were you able to concatenate all users/groups into a single string?
something like "tostring(joinarray(tp!assignees, ","))", or maybe even as simple as "tostring(tp!assignees)", or similar - the report (invisibly and on the back end) wants to treat "assignees" like an array, and you have to force it to not render that way. It requires some real hammering-into-shape before it works with basic filtering, annoyingly.
I typically try to reverse the order of aggregation. When I need a report that shows tasks for a user, I use a user context report. Then I add the process model ID as a column, and then filter by process model in the query. This is much easier than the other way around. Depending on your use case, this might be an option for you.
Thank you for replying! I'm going to try out both solutions and see what works best for me.