Retrieving User list based on currentuser role

0
Hello everyone   I would like to retrieve a list of users based on the current user’s role using a Microflow.   For example, the user A’s role is (HR), while User B’s role is (Finance). each user should only see a list of users with the same role. I’ve tried Multiple approaches but none of them worked unfortunetly.   Any assistance would be greatly appreciated.    
asked
2 answers
1

 

Hi Abdulla,

1) Retreive the current account from database (xpath : [id='[%CurrentUser%]']
2) Retreive the userole of the current account from datbase (xpath: [System.UserRoles=$CurrentAccount]
3) Retreive the all the accounts with retreived user role from database (xpath: [System.UserRoles=$UserRole]

 

 

 

 

answered
0
  1. retrieve UserRole with xpath UserRoles = ‘[%currentUser%]’
  2. activity ‘create list’ for entity User, giving it name ‘UsersHavingARoleLikeCurrentUser’ (or something shorter)
  3. loop over the UserRoleList and in the loop:
  • retrieve UserList with xpath [UserRoles = iteratorUserRole] 
  • add this UserList to ‘UsersHavingARoleLikeCurrentUser’
answered