isusermemberofgroups Function

Certified Senior Developer

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

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Danny Verb

    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
    )

Children
No Data