I have created this rule to get the group names from my task report in a grid . but when there are multiple groups are present at assignee column, it gives error saying invalid group exception.
Here is the code:
if( or( runtimetypeof( ri!groupOrUser ) = tointeger( 'type!{http://www.appian.com/ae/types/2009}Group' ), like( ri!groupOrUser, "?Group:*" ) ), touser(group( togroup( touniformstring( ri!groupOrUser ) ), "groupName" )), rule!APN_displayUser( touser( ri!groupOrUser ) ) )
Rule input-user or group
Any suggestions?
Discussion posts and replies are publicly visible
This is hard to read. Could you edit your post and throw all that code in a Code Box, with indentation restored, etc?(edited to add: thanks! much better now.)
Also in case it helps, I have a similar task report which passes the value(s) in the "assignee" column into this rule, essentially "APN_displayGroupOrUser()", with a single rule input of type "user or group".
if( runtimetypeof(ri!groupOrUser) = 'type!{http://www.appian.com/ae/types/2009}Group', if( isnull(ri!groupOrUser), null(), group(togroup(ri!groupOrUser), "groupName") ), rule!APN_displayUser(user: ri!groupOrUser) )
When there are list of groups like 2 groups it doesn’t work . In expression rule it gives the group name for first group and at interface it through an error for invalid group exception
Where and how are you trying to handle the assignee elements? By default the report returns an array of assignment values (person or group), so in my interface I iterate over all such entries using a!forEach.
I have used a! for each function only but its giving me group id not name
Can you post the full context for what you're trying to do in your grid column, like I have above?
Are you now calling a helper rule similar to the one I showed you above? Where is your a!forEach() statement, and how is it structured?
yes i am using the similar rule.
screenshot of formatting rule.
Report is returning both user and groups.
I have tried multiple ways of getting group name ,everytime its giving me group id instead of name
Can you share the current definition for the Assigned To column of the report itself? It seems like someone may have altered that - like if it's coming through as a single string, that will definitely throw off your ability to show it in your interface the way we're currently trying now. It should look something like this:
FYI, i have a single App Market contribution to my name, and it's a SAIL task list with pre-built robust implementation of just this sort of thing. So if all else fails, please feel free to download this and compare/contrast with what you're currently trying.community.appian.com/.../advanced-user-task-report