Hi All,
I am using the following expression rule to check whether the loggedin user belongs to a group or not. If he/she belongs to a group then it returns "True", otherwise it returns an "Error" instead of returning "False". Please help me to handle this error. Thank you.
For your kind reference,
if( isusermemberofgroups( loggedInUser(), ri!groupIdInput ), true, false )
Error Occurred
Expression evaluation error at function 'isusermemberofgroups' [line 22]: [InvalidUserException]
Discussion posts and replies are publicly visible
What version of Appian are you on? Can you also attach the entire expression? In your example, your error says line 22 but your expression only has 8 lines.
Hi, Danny. Thanks for your response.
Version: 20.1
Yes. It has 8 active statements only and others are commented. I have used them for testing purpose. Thank you.
For your reference,
/*if(*/ /*isusermemberofgroups(*/ /*"test@test.com",*/ /*cons!NVMS_GROUP_Admin*/ /*),*/ /*true,*/ /*false*/ /*)*/ /*if(*/ /*isusermemberofgroups(*/ /*ri!usernameInput,*/ /*user(loggedInUser(), "email"),*/ /*loggedInUser(),*/ /*ri!groupIdInput*/ /*),*/ /*true,*/ /*false*/ /*)*/ if( isusermemberofgroups( loggedInUser(), ri!groupIdInput ), true, false )
Does this work if you use the built-in function "isusermemberofgroup" rather than the plugin function "isusermemberofgroups"?
Hi. I am getting this error while using the built-in function only.
Sorry, to clarify, you mean you just tried this with the built-in function, and you got an error? Are you running this as a system administrator or a basic user?
Yeah. System administrator only.
I think you are using this function in process model or expression rule you are using in process model script task.
loggedinuser function don't work in process model instead of it you can use pp!initiator (Process Initiator) or tp!owner (Task Owner)
local!isLeaseGRPMember:a!isUserMemberOfGroup( username: local!loggedUser, groups: cons!FR_LPI_LEASE_TEAM_GRP_CONSTANT ),
readOnly: if( local!isLeaseGRPMember, true, false )
im using this in interface still i was getting the same error
Interface Definition: Expression evaluation error at function a!isUserMemberOfGroup [line 3]: [InvalidUserException]
------------where line 3 is local!isLeaseGRPMember:a!isUserMemberOfGroup(username: local!loggedUser,groups: cons!FR_LPI_LEASE_TEAM_GRP_CONSTANT),
Hi sureshkumarj0001,
What is the visibility & privacy policy of this group, cons!FR_LPI_LEASE_TEAM_GRP_CONSTANT?And when are you getting this error? while running the flow/ request?
Hi,
Do you get the solution on this? I am facing similar issue. I facing this issue with only one user which is deactivated in system.