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…

Leave a 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