suggestions for expression rule to get user from a list that is a member of a certain group

 Hi,

Any suggestions on how to achieve this efficiently?

 

I have users in the system that have different logins but the same email address.  I'm using the getusersby() function and getting this array of users (typically 2 users) via their email address.

I would like to now take this user array and determine which one is a member of Group A and return that one user account.

I was thinking of an expression rule that basically:

-If count(pv!users)=1, pv!users[1],

        if pv!users[1] is member of Group A, pv!users[1], pv!users[2] 

 

However, in this solution, it only accounts for 2 accounts returned and assumes that if the first user account is not in Group A, then the 2nd one must be.

This will probably work in our environment but I would prefer to have something that is more flexible and can loop through more than 2 and doesn't assume the 2nd account is in the group if the first one isn't a member of it.

 

Any suggestions?

 

Thanks in advance.

 

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data