Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
6 subscribers
Views
6154 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Does user belong to groups
marcoc918
A Score Level 1
over 7 years ago
Hi,
we used the function doesuserbelongstogroup on 1 of our production environment, but due to an error we don't have this function on our other production environment, does anyone remember and can insert the link to the shared component that include this function
Thanks
OriginalPostID-265486
Discussion posts and replies are publicly visible
0
sowjanyav430
over 7 years ago
@Marcoc..
Please find the below link to the shared component that include doesuserbelongstogroup function.
forum.appian.com/.../summary
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 7 years ago
The plug-in recommended by the user in the comment above NO LONGER has that function. I removed it from my plug-in because the out of the box function
docs.appian.com/.../Scripting_Functions.html
function matched the desired behavior so there was no need to keep maintaining something custom. I suggest you use that one instead.
The People Functions has something similar called isusermemberofgroups
forum.appian.com/.../summary
if you wanted to do the check for multiple groups.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marcoc918
A Score Level 1
over 7 years ago
ok,
I have read and tested the function isusermemberofgroups and for other project I use it, so probably is better to substitute it with this function
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
in reply to
marcoc918
When I use the isusermemberofgroups function and the user is not a member of the group, it doesn't return false, it just errors out. Has anyone experienced this as well?
Details: ERROR:An error occurred while evaluating expression: auReviewer_cdt.reviewer_usr:if(isusermemberofgroup(tp!owner,getgroupbyname("P2P_Pay_Invoice_Admin")),pv!auReviewer_cdt.reviewer_usr,tp!owner) (Expression evaluation error at function 'isusermemberofgroup': Error evaluating function 'isusermemberofgroup' : Invalid null group ID argument.) (Data Outputs)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
amanit
A Score Level 1
over 7 years ago
in reply to
garym
garym
The above mentioned error is telling there is some problem with the group Name. As per my understanding there is no group with name "P2P_Pay_Invoice_Admin" so its throwing that error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 7 years ago
in reply to
garym
Please have a null check on getgroupbyname("P2P_Pay_Invoice_Admin"),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
harshav
over 7 years ago
in reply to
garym
Try passing that from a constant, like call that group in a constant and call that constant here so that there will be no need to even doing the null check , and as the practitioners said this error is not due to the user doesn't belong to that group it is due to the group parameter
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel