Rudixx
Forms Fledgling

Get Display Names from another site list's multi person column

Jump to solution

Hello

 

I am trying to get Display Names from another site list's multi-person column. 

 

I have Nintex Workflow where I use Query List with CAML query to get a list of supervisors and managers for a department. 

 

<Query>
<Lists>
<List ID="{23BC57C8-2E5C-462E-BFCE-EDFE10046D36}" />
</Lists>
<ViewFields>
<FieldRef Name="Manager_x0020_Person" />
<FieldRef Name="Supervisor_x0020_Person" />
</ViewFields>
<Where>
<Eq>
<FieldRef Name="Department" />
<Value Type="String">{ItemProperty:Department1}</Value>
</Eq>
</Where>
</Query>

 

I store the results in two separate variables, var_Supervisors and var_Managers (I tried a single line of text, multi and collection).

 

As expected the results are saved in format i:0#.w|<domain>\<username>;i:0#.w|<domain>\<username>.

I want to use the results in e-mail notification but instead of userIDs, I would like to have Display Names. 

 

I tried to use For Each action on the collection variable and Set Variable where I change the data type to Display Name, Semicolon delimited but with every possible variable type (SLOT, MLOT, Collection, POG) the workflow crashes with the error "Coercion Failed: Unable to transform the input lookup data into the requested type."

 

Any ideas on how this can be fixed?

 

Note: I did have Run if action to only run if the variable is not empty.

0 Kudos
Reply
1 Reply
Rudixx
Forms Fledgling

Re: Get Display Names from another site list's multi person column

Jump to solution

I managed to get the results I wanted but the workflow is not pretty so if any of you know how it could be simplified, please share your ideas.

 

1. Query List to get approving managers and supervisors.

Rudixx_0-1630667060789.png

 

2. Regular Expression to split COL_Supervisors items .

Rudixx_1-1630667115399.png

 

3. For each to loop through all items in the COL_Supervisors collection variable and store them in people or group variable POG_Supervisors.

Rudixx_2-1630667162617.png

 

4. Run if the POG_Supervisors variable is not empty.

Rudixx_3-1630667269088.png

 

5. Set variable to store display names in a single line of text variable SLOT_Supervisors (not semicolon delimited).

Rudixx_4-1630667362335.png

 

6. Build String to concatenate the display names.

Rudixx_5-1630667458717.png

 

7. Regular Expression to get rid of the last comma from DisplayNames_Supervisors variable.

Rudixx_6-1630667508994.png

 

Now I repeat the above to get the names for managers. 

 

The workflow:

Rudixx_7-1630667715008.png

 

View solution in original post

0 Kudos
Reply