“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 type | Prefix |
---|---|
User | i:0#.f|membership| |
M365 group | c: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'}]"
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.
Hi can i know the same process for Sharepoint group.
Hello Divya,
for SharePoint group use the group name instead of claims login as the FieldValue, e.g.
“FieldValue”: “[{‘Key’:’SharePoint group name’}]”
Thank you a million times over.
Hi, how can we use this in a bulk update with power automate?
Ref: https://www.tachytelic.net/2021/06/power-automate-flow-batch-create-sharepoint-list-items/
Hello Robin,
I believe that you can update any column type, but I never did it using the batch action. Try to ask the question on Paul’s blog.
Hello Tom great solution !!!am looking to create an people or group type item by send batch HTTP request to sharepoint can you guide me how to create people or group type item using batch request.
Hello Manjunath,
I don’t know what you mean by people or group type item.
If we’re trying to create list item and not update an existing one, what changes are needed for the API call?
Hello Robin,
you’d need a different API call for item creation as explained here: https://tomriha.com/create-item-with-lookup-column-in-a-dynamic-list-power-automate/
Hi Tom
I’m trying to update an optional people picker field. I’m trying to concatenate the required string but because it contains all these apostrophes (‘), it doesn’t work.
I can’t compile in the HTTP body because that fails the update.
Do you have any guidance on that?
Currently my workaround is to contain updating that one field in its own action but I would like something more elegant.
Thanks,
Christine
Hello Christine,
I think that when used in expressions the apostrophe character is represented by 4 apostrophes to differentiate it from a parameter defining apostrophe.
Thanks a lot for this guide. I couldn’t figure out how to add a group to a new Item in a SharePoint List. It was easy to find for users, using claims, but no examples for SharePoint Groups. And it’s so easy. I know this article is not about PA and creating new items, but it helped me to solve my issue.
Solution:
User: {“Claims” : “i:0#.f|membership|xxxx@xxx.xx”}
Group: {“Claims”: “SharePointGroupName”}
Thanks.
Ota
Hi! How can I do something similar but for creating a new item with a new user in people type column? I’ve been trying to follow this method, but in my case I’m not updating an existing item, I’m creating a new one.