How do I get the manager for more than one person in a single people picker field?

  • 27 July 2015
  • 1 reply
  • 17 views

Badge +3

I have a simple form that allows a user to enter one or more users into a people picker field. On save an email gets sent that needs to be cc'ed to the users manger/s.

The issue I have is I can use the query user profile action to get the manager, but it only returns the manager for the first person. How do I get the manager for all users in the people picker?

 

Thanks in advance!

Suzanne


1 reply

Badge +3

Ok, I got this working. For anyone who is interested I did the following steps:

1- Save the people picker field into a string variable

2- Run a Regex action to strip the numbers and ;# from the string

3- Run another Regex to split the remaining string into a collection variable to identify individuals

4- Use a for each action to loop through the collection variable. Inside the loop I did the following:

     a- Use a Query LDAP action to get the users username

     b- Use a Query user profile action on the username to get the manager. I know I could do this via LDAP, but this gave a cleaner result

     c- Check if the manager is already in the list, if not then add to the string variable that contains the managers

 

I must give credit to this blog post which helped immensely Workaround person or group field one value problem Using Nintex Workflow 2010 | SharePoint Lady

Reply