Skip to main content
January 12, 2024
Question

How to check if the user that triggered the process belongs to a group at XOR node?

  • January 12, 2024
  • 11 replies
  • 0 views

Hi community members,

So in a process model, I added a XOR node. In the condition I put "=a!isUserMemberOfGroup(loggedInUser,  a!groupsByName("Test group"))". The purpose is if the user belongs Test group it will go to path A. If not it will go to path B. So I'm sure the loggedInUser belongs to Test group, however when testing, after this XOR node it goes to path B.

Did I make some mistake on that expression? I tried "=a!isUserMemberOfGroup(pv!loggedInUser,  a!groupsByName("Test group"))" and it was not working too.

Any suggestions?

Based on suggestions,  I created a constant for the group and use the expression a!isUserMemberOfGroup(loggedInUser(),cons!TEST_GROUP) . However it still didn't work as expected in the XOR node (not outputing "true"). But when I test the expression outside of the process, it outputs "true". So I'm wondering what's potential issue here?

Thanks.

11 replies

sriramk5349
January 12, 2024

Hi [mention:fd3f2b08e5d345ac90ca4bc7e410e2a3:e9ed411860ed4f2ba0265705b8793d05] ,

Please check whether the  a!groupsByName("Test group") is returning any groups, if not, then the condition will fail. And if possible, add the groups in constant and try. That might work.

harshitb6843
January 12, 2024
pv!loggedInUser

What is the value of this variable?

rithanir5887
January 12, 2024

Hello [mention:fd3f2b08e5d345ac90ca4bc7e410e2a3:e9ed411860ed4f2ba0265705b8793d05] ,

As Sriram said, try to check if the function returns expected output in an expression.

Sometimes, when you try to run an expression with a!groupsByName() function, it may not return the expected group when you don't have permission to see that group. Please check the Group Visibility once and try, if that helps.

To know more about the function, refer link . Please go through the usage consideration once.

stefanhelzle0001
Brainy
January 12, 2024

I would never try to reference groups by name. Groups can be renamed and the you app breaks. Use constants of type group instead.

noahc4544Author
January 12, 2024

Thanks, I created a constant for the group and use the expression a!isUserMemberOfGroup(loggedInUser(),cons!TEST_GROUP) . However it still didn't work as expected in the XOR node (not outputing "true"). But when I test the expression outside of the process, it outputs "true". So I'm wondering what's potential issue here?

harshitb6843
January 12, 2024

loggedInUser() doesn't work in a process. Try pp!initiator

jayaprakashr0001
Participating Frequently
January 12, 2024

Hi noahc5006,

Instead of using a!groupsByName() create a constant for the group and call the constant in the a!isUsermemberOfGroup(loggedInUser(),cons!TEST_GROUP) it will resolve your issue.