Power Automate – How to update Single or MultiPerson field in SharePoint

Introduction

Hi friends, in this post let us see how we can update single or multiperson field in SharePoint list using Power Automate actions. We will update the field using the out-of-box Create Item action. This does not applies to the field if the Selection of groups is enabled.

Focus on the Flow

The scenario is by creating an item in List B when an item in List A is created or updated. Both the lists has same fields listed below

  1. Title – Default field
  2. Single Person – Person or Group field with no groups allowed and only one person is allowed to select.
  3. Multiple Person – Person or Group field with no groups allowed and multiselection of people is allowed.

Let us start designing the flow

  • Create an automated flow, give a unique name to the flow and select the trigger named ‘When an item is created or modified‘ as shown below
  • Choose the Site Address and List A for the List Name property
  • Add an action ‘Initialize Variable‘ and provide the properties as mentioned below. This variable will store the choices from an item from the source list.
    • Name – SinglePersonValue
    • Type – String
    • Value – Select claims from the triggerOutput
  • Add an action ‘Initialize Variable‘ and provide the properties as mentioned below. This variable will store the choices from an item from the source list.
    • Name – MultiPersonValue
    • Type – Array
    • Value – []

Note: The above variable is defined for storing all the claims from the multi-person field.

  • Add an action ‘Append to array variable‘ and provide the following properties
    • Name – variable ‘MultiPersonValue‘.
    • Value – Choose the Mutliple Person Claims from the triggerOutputs
  • Once you chose the value, since it is a collection returned from the trigger action, flow will automatically wrap the above action inside an Apply to each action as shown below.
  • Add an action named Select and provide the below properties
    • From – choose the MultiPersonValue variable.
    • Map – key as Claims and value as item() (dynamic expression)

To update the person field of multiselection, we have to pass the values like below to the Create Item action.

[
  {
    "Claims": "<User 1 claims value>"
  },
  {
    "Claims": "<User 2 claims value>"
  }
]
  • Now we are ready with the values, add an action named Create Item and choose the properties below
    • Site Address – Site collection where the destination list reside
    • List Name – Destination list name, once it is selected, the action will automatically display all the editable fields
    • Choose the value for the Title and other fields. For the Person field, choose the SinglePersonValue if it is a single selection and choose Select output if it is a multi-selection field.

Thats it, we are done with the flow. Try add or modify an item in List A, the flow should be triggered and the same item with all the metadata including the person field should be added to the List B.

Happy Flowing…

19 thoughts on “Power Automate – How to update Single or MultiPerson field in SharePoint

  1. What is the Item you are mapping to the Claims in the Select action? I don’t have that option in my dynamic content. It looks like a Sharepoint Item but I don’t know what it is…

    Like

  2. I just ran into an issue of trying to import historical data from our HR system (SQL) into a SP List for a new PowerApp. We used Person or Group for the Supervisor of the employee. It is working great to just use the email address. However, it fails if the user doesn’t exist. 😦

    I came across this post and that makes sense to put it into a variable. Then, I thought I could set the expression for the supervisor to the email only if that email is for an existing user.

    I don’t think there is a way to resolve the user via the expression, though. Do you know? If not, I guess I’ll need to set the variable, resolve the user and then set the variable to the email or blank, depending on the results of resolving the user.

    Do you have any thoughts on that?

    Like

  3. Thanks for this blog post. You really saved me many hours of work. I was stuck and on the point of giving up in frustration.

    Like some others, I was confused about the line that said “Map – key as Claims and value as item() (dynamic expression)”, but once I understood that you literally type in the text “item()” as a dynamic expression and then I saw that it worked, I was over the blockage.

    I expected some auto-complete text to pop up when typing “item()” in the dynamic expression to hint I was going in the right direction. This lack of prompting initially fooled me into thinking I was doing the wrong thing.

    I got it all working in the end, with two separate lists of people merged and duplicates removed (using a “Compose” action and a dynamic expression to “union” my array with itself).

    Thanks again for your help.

    Like

  4. Hi Dude,
    I have tried the same method in my requirement and ended up with the below error:

    The specified user item() could not be found.

    I am currently doing this logic – Excel upload to Sharepoint list flow. However, I cannot add multiple emails to a SharePoint list field which is a people/group. Basically, I have an excel file with columns that may have 123@gmail.com;456@gmail.com

    Kindly suggest where am I doing wrong. Please suggest an alternate solution if this method will not work out

    Like

Leave a Reply to sminhinnick Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s