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…

29 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

  5. Pingback: Power Automate Astuces | KTNN SharePoint

  6. Hi thank you for this nice post!
    I got a list with 12 person fields (single or MultiPerson field)
    I got a problem if the field is empty. Do you have an idea how to handle this issue?

    Thank you!

    BR,
    Tobi

    Like

  7. Hello, thank you for posting. I followed the steps exactly but I am still getting the “user not found” error. Any suggestions?

    Like

    • Hi, may i know on which action you are receiving this error. Can you check whether the user you are trying to update exists in the site? Also to verify, create a simple flow to get the items from the list and add a people picker field and add the users so that you can see the results which has the claims id to verify whether you are passing the same claims id or not.

      Like

      • When you create the item and set the multiple person field, click the little icon next to the field called “Switch to detail inputs for array item”. It is clear when you study the screenshot. Had the same issue as Han where it said “User not found” while i was sure that the user still exists and it took me a while to figure it out. Thank you for this post , you saved me from a headache.

        Like

  8. Hello Sudharsan,

    Thank you very much for your help!

    I have an issue when it comes to my array.
    I am using your function but with a Choice Type of Column
    Managed to edit the Claims to Values and everything works fine but when I run the flow each person has their items + the items from the people before them.

    I believe it has something to do with the selector but I don’t know how to edit it for a Choice Column instead than a User column

    Thank you in advance for your help.

    Like

Leave a comment