cancel
Showing results for 
Search instead for 
Did you mean: 
siddharth_v

Update Multi-Values with People Picker Field in Power Automate/Microsoft Flow

Introduction 

In this article, we will learn how to update multi-values with the people picker field in Power Automate or MS flow. Updating a multi-value people picker field in MS flow or power automate is a little tricky, and recently a friend came to me for help on this. After lots of trial and error, I was finally able to manage to update the multi-value people picker field. Let us see how to achieve this.
Objectives
  • Find an Office 365 group ID associated with site
  • Find a list of all members of this office 365 group
  • Add these members to a list column (people picker with multi-value) 
Let's start by building our flow.
 
For demo purposes, we will use manual trigger action.
 
Step 1
Add "Manually trigger a flow"  as a trigger point.
Step 2 
Add Initialize a Variable action, select type as Array
 
1.png
 
Step 3
 
The next thing we have to do is get the Office 365 group ID associated with the site.
 
To get a group ID of the site, we can use the endpoint '_api/site/',  which has GroupId as properties, this is the GroupID of the Office 365 group.
 
Add the action, "Send an HTTP request to SharePoint", and select parameters as below. 
 
Though I have selected the site address directly from the dropdown, you can always use dynamic content or expression (if you are getting the site URL from somewhere else) 
in Uri, I am directly using _api/site/GroupId so that I don't get any other site properties (which I don't require in this case).
 
Step 4
 
The next thing we will do is use Parse JSON action so that the response of the above action can be directly used in the next steps from a dynamic content window.
 
Use below sample JSON as payload in 'Use sample payload to generate schema'.
 
{
"d": {
"GroupId": "8db58c1c-22-232-adde-2332"
}
}

 

2.png

 

Step 5
 
Now that we have GroupId of office 365 group, we will query group members by using the action 'List group members'.
 
3.png
 
Step 6
 
The above action will return an array of group members so we will have to loop through each member and generate the required array to pass to people picker column.
 
Add 'Apply to each' action, select an output of above action in 'Select an output from previous step'
 
Step 7 
 
Add a compose action and the below JSON string, you can always replace  @{items('Apply_to_each')?['mail']} by selecting dynamic content mail property from 'List group members'. As you can see in the screenshot below, (with marked as 7), I have used a dynamic content selector to add mail property. 
 
{
"Claims": "i:0#.f|membership|@{items('Apply_to_each')?['mail']}",
"Email": "@{items('Apply_to_each')?['mail']}"
}

 

Step 8 
 
Append this compose method output to Array. Select 'Append to Array variable' action and select Managers as the Name, and 'output' as the value.
 
4.png
 
Step 9 
 
Now we have the required object to update the people and group column. Now let's use the create item action and select values accordingly.
 
For the Managers column, (which is people picker with multi-value allowed), click on the icon marked with a green arrow in the below screenshot. This will switch to input for th entire array. Select the Mangers variable here. 
 
5.png
 
Save workflow and test it. If everything goes well, it should run successfully.
 
6.png
 
Let's check in the list item.
 
7.png
 
We should see that multiple users are updated in the Manager field. 
 
Conclusion
 
Updating the people picker column with dynamic values is a little tricky. This article will give you the basic idea of how to form JSON which is required to update the PeoplePicker column if our user's value is not coming directly from SharePoint. 
 
Hope you enjoyed reading...Happy flowing..!!!
 
P.S - This article was originally published at this link
Comments
About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/