Is there a way to get the group names by passing the user name who are the direct users of that groups.
Parent Group: Group 1, Child Group:Group 2
Group 1:(user A, user B), Group 2:(user c)
If I pass user c, the result should be Group 2.
getgroupsformemberuser() returns all the groups irrespective of direct or indirect membership
I think you need to break this down into a set of discrete steps:
This might work:
a!forEach( items :getgroupsformemberuser(loggedInUser()), expression :group(fv!item,"groupName") )
This will do it, but for environments with a very large number of users and/or groups it may take a while and consume a lot of memory. Our environment has only about 1k users, so we can get away with it.
You will need the People Functions and Group Functions plugins to use this. Replace rule!CMN_checkIsNullOrEmpty with your favorite null/empty list checking function.
Also note that groups will still be returned where the user's Member Type is Rule. Not sure how to get around that.
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.