cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Beerman212
Level: Powered On

Populate Multi-Person field in sharepoint without HTTP request api

I spent quite a bit of time trying to figure out how to populate a Multi-person field in sharepoint using flow recently and I found very little helpful information about it.  Most of the information I found involved using the sharepoint connector's HTTP request api to try to populate the field, which I had very little luck accomplishing.

Through the course of this process, I figured out how to populate a multi-person field in a sharepoint list without calling the HTTP request api. 

The solution in question involves the use of an array, the Resolve Person action in the sharepoint connector, and the Compose data operation.  I've created a basic flow to demonstrate.

 

First the Setup.  I have a sharepoint list that has a EmailsChosen field.  This is a choice select, with various email addresses as the options.  Multiple selections are possible.  I also have an unpopulated field AssignedPerson.  This is a person field, with multiple people selected.

MultiSelectEmailField.png

 

MultiSelectPersonField.png

 

The flow will take the selected items in the EmailsChosen field, and populate the AssignedPerson field using the above mentioned actions.

 

I am just going to iterate over all the records in my list (I only have 1 record) for this example.

 

First, initialize an array, and get your list items.

 

FlowInitialize.png

 

Then, Loop over all items in your list, and over all items in the EmailsChosen field.  This is bad computationally, but since the sample is so small, I'm doing it.

 

The loop consists of the folowing actions


Resolve the person against the AssignedPerson field.  Advanced Options must be selected, and a view with the AssignedPerson field must be selected for this to work.

 

ResolvePerson.png

 

Then, compose the results into a json object. Special Note: the @ character must be escaped when using compose.  Just add a second @ character right in front of it.

 

Compose.png

 

Lastly, Append the composed object to the array.

 

AppendToArray.png

 

When the loop is finished, use the SharePoint Update Item action to add the array to update the AssignedPerson field.  The default setting is to send 1 claim into the field, click the icon to the right under the field to enable Array input, then you can pass the whole array of people into the field.

 

SwitchToArrayInput.pngClick button to switch to array input

 

InputPersonArray.png

 

When dealing with multi-person fields, if there is only one person sent in you can do just the claims and it will work, but this method will work for all situations where you are sending any number of people into the field.

>