hello everyone 🙂
I'm having alot of trouble updating a People Picker column in a SharePoint Document Library using the Send an HTTP request to SharePoint action.
I'm using SharePoint Online.
The name of the Document Library is DCR.
Here are the settings on the column:
- field name = ProcessOwners
- required = yes
- allow multiple selections = yes
- allow selection of = people and groups
- choose from = all users
Here is what the column looks like:
here is my Send an HTTP request to SharePoint action:
easier to read body:
the file ID is 101
when i test the flow, it says it is successful
buttt the ProcessOwners column doesnt change.
I really want to use the 'Send an HTTP request to SharePoint' action,
i don't want to use the 'Update file properties' action
(i have a tonne of required columns in this library, and only want to edit one specific column)
do anyone know what is going wrong?
Solved! Go to Solution.
Hi @Cam,
You could use the validateUpdateListItem method and in that case you just have to use the Claims value in the body of the POST request. @tom_riha has written a great blog about updating a person field with this method:
https://tomriha.com/how-to-easily-update-sharepoint-people-picker-column-in-power-automate/
Below is an example:
URI
_api/web/lists/GetByTitle('DCR')/items(101)/validateUpdateListItem
Body
{
"formValues":[
{
"FieldName": "ProcessOwners",
"FieldValue": "[{'Key':'i:0#.f|membership|johndoe@contoso.com'},{'Key':'i:0#.f|membership|janedoe@contoso.com'}]"
}
]
}
Hi @Cam,
You could use the validateUpdateListItem method and in that case you just have to use the Claims value in the body of the POST request. @tom_riha has written a great blog about updating a person field with this method:
https://tomriha.com/how-to-easily-update-sharepoint-people-picker-column-in-power-automate/
Below is an example:
URI
_api/web/lists/GetByTitle('DCR')/items(101)/validateUpdateListItem
Body
{
"formValues":[
{
"FieldName": "ProcessOwners",
"FieldValue": "[{'Key':'i:0#.f|membership|johndoe@contoso.com'},{'Key':'i:0#.f|membership|janedoe@contoso.com'}]"
}
]
}
you sir, are a legend!
here is the action - and it works!
=========
note, if anyone else gets the "Value cannot be null" error message in Power Automate, please see this thread to fix it:
you need to make sure the headers on your HTTP action are similar to mine.
(as Reza has suggested)
get rid of the x-http-method header... it was causing me to get that error.
thank you @Expiscornovus
User | Count |
---|---|
5 | |
5 | |
4 | |
2 | |
2 |