Skip to main content
priyankap3485
July 11, 2022
Question

a!isUserMemberOfGroup throwing InvalidUserException

  • July 11, 2022
  • 11 replies
  • 0 views

Hi All,

I am getting error in below expression 

a!localVariables(
           local!userName: "xyzUser",
           if(
                isusernametaken(local!userName),
                a!isUserMemberOfGroup(local!userName, cons!PP_GROUP_CONSTANT),
                0
              )
)

Error as

Expression evaluation error at function a!isUserMemberOfGroup [line 5]: [InvalidUserException]

I observed this issue with deactivated user in only one environment where in lower environment its working fine with deactivate users as well.

Thanks in Advance!

11 replies

edwarda1815
July 11, 2022

I believe that you need to pass the User as a type User by :


touser(local!userName)

priyankap3485
July 11, 2022

Thanks for reply. Tried this, its still not working.

harshitb6843
July 11, 2022

I don't think it is a version issue. What Appian version are you using?

priyankap3485
July 11, 2022

its 21.4 on both environment.

stefanhelzle0001
July 11, 2022

Even a deactivated user will return true for isusernametaken(). But a!isUserMemberOfGroup() will fail on that exact user. To check whether a user is deactivated, you will need to user the function isuseractive() out of the people functions plugin.

priyankap3485
July 11, 2022

Hi Stefan,

Thanks for reply.. but this function is working properly in one of the environment with deactivate user as well and not in other.

peter.lewis
Employee
July 11, 2022

If you're seeing exactly the same expression behave differently in different environments then I would suggest opening a support ticket.