PowerApps – Update MultiPerson field in SharePoint through Power Automate

This blog will discuss how we can update a multiperson field in Sharepoint using Power Automate and input from PowerApps.

Background

In some cases, you may have a multi-select person in PowerApps and you want to send to Power Automate for other business processes like Approval or sending data to other systems. Along with you want to create Create SP List item.

Multi-Select is always a unique process and challenging either using PowerApps or Power Automate. It gives us more challenges when we use both.

PowerApps UI

 

Call the Flow

FlowName.Run(Concat(ComboBoxMultiSelectPerson.SelectedItems.Mail, Text(Mail) & “;”))

 

Power Automate (Flow) – All actions

 

Power Automate Actions Explanation

  • Create an instant cloud flow, give a unique name to the flow, and select the trigger named ‘PowerApps‘ as shown below

  • It creates a trigger action like below

  • Add an action ‘Initialize Variable‘ and provide the properties as mentioned below. This variable will store the input from PowerApps.
    • Name – Selected Persons in PowerApps
    • Type – String
    • Value – Place the cursor on the Value and click “Ask in PowerApps”

  • Add another action ‘Initialize Variable‘ and provide the properties as mentioned below. This variable is defined for storing all the claims from the multi-person field.
    • Name – MultiPersonValue
    • Type – Array
    • Value – []

  • Add an action ‘Apply to each’ and this will loop through each email by using the split function
  • Add a condition to verify the email is not empty

  • Add an action ‘Append to array variable’ and set the claims for each email. 

{
“Claims”: “i:0#.f|membership|@{toLower(item())}”
}

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

[
{
“Claims”: “i:0#.f|membership|stalin@learntoilluminate.com”,
},
{
“Claims”: “i:0#.f|membership|John@learntoilluminate.com”
}
]

  • Add an action ‘Create item’
    • Site Address – SharePoint Site collection
    • List Name – SP List Name
    • Enter all mandatory values
    • For the Person field, choose the MultiPersonValue on a specific multi-selection field.

  • Switch to Input entire array (This below step is required to assign your array variable to the field)

Conclusion

We are able to call Power Automate from PowerApps and update multi-select persons in SharePoint

 

Thanks for reading!

Leave a Reply

Your email address will not be published.