Updating Multi-person Fields in a SharePoint List using Microsoft Flow

Microsoft Flow, or Power Automate as it’s now known, makes it quick and easy to harness some awesome functionality – but every now and then you find a seemingly simple problem for which a simple answer is…elusive. Updating multi-person fields in SharePoint Lists is one of those tasks.

Let’s just check that we’re talking about the same thing. You have a list in SharePoint (or in Teams) with a Person/Group lookup field that can take multiple values. You created some automation in Power Automate – maybe an approval, or creating a list entry when data is received elsewhere – that needs to update the list item. Note that you might not be interested in updating the multi-person field itself, but if this is a required field or you want to preserve an existing value then it’s a necessary evil in the current Update Item action in Power Automate (July 2021).

The solution requires a three-step “combo” move…

Firstly you need to know the “identity claims” for the person or people to write to the field. If you are updating an existing list item, like in my example, then you can retrieve the current data using the Get Item action. The Resolve Person SharePoint action can be used to obtain the claims for other people, and this can be combined with Get User Profile to search AD first. Note that the identity claims will always be an array (even if it’s empty or only has one value).

Secondly you need to store these in a very specific array structure. This is strangely hard if you’re using a multi-person field value from Get Item. This is because Get Item returns this type of field as an array of people, with each person stored as a map of attributes – and several of the attributes (such as the display name and email address) are read-only. Only the claims attribute is writable. So we need to build a map that contains just the claims attribute for each person. This can be done with a Select data operation block using your original multi-person field as the source (I had a column called Employee in my example), and mapping a single key called Claims to the claims attribute.

(If you obtained the claims data in a different way then this step will be different for you)

Thirdly you need to write these as an entire array in the Update Item action. The multi-person field will have an icon to the right that switches this field between using an array or manual row-by-row entry. You need the entire array option, and select the output from your earlier Select data operation as the value.

That should be all there is to it. What I like about this solution is the elegance of the Select data operation to transform the multi-person field data from Get Item into a format suitable for Update Item.

Leave a comment