How to easily update SharePoint people picker column in Power Automate

“Can I use ‘Send an HTTP request’ to update only people picker SharePoint column with Power Automate? My request doesn’t update anything!”


When you search for solution to update SharePoint people picker column, you’ll probably end up with an HTTP request using the user ID. You’ll be asked to get the user ID first, and then update the item using that ID. That’s one HTTP request to get it, then process the result, and finally update the item. It’s not the most straightforward solution.

I believe it’s much easier to use an HTTP request with validateUpdateListItem. It’s the same request you use to update a single SharePoint column, but with different body.

HTTP request to update people picker column

The action you’ll need is the ‘Send an HTTP request to SharePoint’ with the configuration below.

Method: POST

Uri: _api/web/lists/GetByTitle('<ListName>')/items(<ItemID>)/validateUpdateListItem

Body:
{
    "formValues":[
	{
	    "FieldName": "<FieldToUpdate>",
	    "FieldValue": "<ValueToUpdate>"
	}
    ]
}

Note: < … > are placeholders, replace them including the < and >.

The difference between a people picker and the other SharePoint columns is in the <ValueToUpdate> part. In the other situations you’d just enter the field value, but people picker needs a specific format for the value. An array with pairs of key ‘Key’ and value ‘claims’ values.

"FieldValue": "[{'Key':'claims'}]"

And since it’s an array, you can use the same format to update also multiple users in the people picker, just extend the array.

"FieldValue": "[{'Key':'claims'},{'Key':'claims'}]"

What is claims?

Claims is a user identifier consisting of a prefix and an identifier: email for users and ID for M365 groups. The prefix depends on the type of user, as shown in the table below.

User typePrefix
Useri:0#.f|membership|
M365 groupc:0o.c|federateddirectoryclaimprovider|

As an example, the “FieldValue” below will update 1 M365 group and 1 user into the people picker.

"FieldValue": "[{'Key':'c:0o.c|federateddirectoryclaimprovider|691a0c9d-xxxx-44e8-yyyy-d6df6cd591e8'},{'Key':'i:0#.f|membership|xxx@tomriha.com'}]"
update SharePoint people picker Power Automate

How to get user claims?

If you’re taking a user from somewhere within SharePoint, you can get his claims directly from the dynamic contents. It’s the ‘Column Claims’ value. If the user is not from SharePoint, you must build the value manually by adding the prefix to the user email.

How to get M365 group claims?

M365 groups don’t provide such an option, you can’t get the claims directly. You must always build the claims by yourself using the prefix and the group ID.

If you don’t know what ID the M365 group has, you can get it with the steps below. The prerequisite is that you must be member of the group you’re trying to add.

Then you can ‘List groups that I own and belong to’, ‘Filter array’ to get only the specific group by its name, and then use the ‘Group Id’ to build the claims.

Summary

It might be challenging to update only a single people picker SharePoint column with Power Automate. It’s not as easy as updating the other columns, or e.g. renaming a file, but it’s not complicated either.

Once you understand the body of the request, you can easily build the array and update the right user(s)/group(s) into the column.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Add a Comment

Your email address will not be published. Required fields are marked *