Check user role in exclusive split

0
I am trying to check a user role in exclusive split with the following code: $currentUser[system.UserRoles = '[%UserRole_administrator%]'] What am I doing wrong? Link to screenshot:   https://ibb.co/RQw2XK3    
asked
3 answers
3

The tokens for userroles are only available in Xpath retrieves, this is a regular microflow expression. And the brackets you use are only used in Xpaths, not here.

So first do a retrieve of a userrole object where ID = userrole_token. Then you can do an exclusive split to check if the association from currentuser to userrole matches that object.

answered
1

You are using an XPath expression in an exclusive split. 

answered
0

I had the same kind of issue. But I had to check if the user had a certain role. This is what I did to solve it. 

  1. You can get the account from a retrieve with: [id = $currentUser/id] (range = first)
  2. I then got all the userroles linked to the account. (retrieve association account)
  3. Retrieve the userrole you need. (retrieve UserRole : [id = ‘[%user you want%]’]
  4. filter with a list operation (contains)

 

Hope this helps for in the future!

answered