Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+2
person also asked this
people also asked this
Replies
5 replies
Answers
1 answer
Subscribers
10 subscribers
Views
9099 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi How can I retrieve a logged in user's group id in a process if
lincolnf454
over 11 years ago
Hi
How can I retrieve a logged in user's group id in a process if the user has been added to a group initially via the people tab?...
OriginalPostID-85340
OriginalPostID-85340
Discussion posts and replies are publicly visible
+1
Michael Tan
Appian Employee
over 11 years ago
Hi Lincoln,
Take a look at the People Functions - Plug-in available in Shared Components. You can retrieve all of the groups a user is a member of using the getgroupsformemberuser function included in that plug-in.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
0
chandrasekharm0001
over 7 years ago
in reply to
Michael Tan
Hi Michael,
If user has been assigned to more than 5 groups,
assume
1) Italy
2) France
3)SuperAdmin
4)SupportAdmin
5)CentralTeam(Parent Group for 1,2).
How can I validate and get Group ID of user whether he belongs to group1 or group 2.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aswinb608
A Score Level 2
over 7 years ago
first you can check if the user is part of a particular group using the function isusermemberofgroup(loggedInUser(), cons!GROUP_NAME)
you can use the group() function....group(cons!GROUP_NAME, "id"). to retrieve the id
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Robert Shankin
Appian Employee
over 7 years ago
I agree with Michael and Aswin on how to get this done.
However, I would recommend a proactive approach to managing group membership that empowers you to avoid this to the greatest extent possible. This operation demands a lot of performance.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Abhay Dalsaniya
Certified Lead Developer
over 7 years ago
RI Array: ri!userBelongsToTheseGroups in following code will give you list of desired groups.
a!forEach(
items: ri!listOfGroups,
expression: if(
isusermemberofgroup(ri!userName, group(fv!item, "id")),
a!save(ri!userBelongsToTheseGroups, fv!item),
{}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel