cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cam
Kudo Collector
Kudo Collector

Update Multi People Picker Column with SharePoint HTTP Action

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

Cam_0-1642492774362.png

 

Here is what the column looks like:

Cam_2-1642493363868.png

 

here is my Send an HTTP request to SharePoint action:

Cam_3-1642493685030.png

 

easier to read body:

Cam_4-1642493788593.png

 

the file ID is 101

Cam_5-1642493897845.png

 

when i test the flow, it says it is successful

Cam_6-1642493968672.png

 

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

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'}]"
	}
    ]
}

 

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

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!

Cam_0-1642552487289.png

 

=========

 

note, if anyone else gets the "Value cannot be null" error message in Power Automate, please see this thread to fix it:

https://powerusers.microsoft.com/t5/Using-Flows/Sharepoint-Post-Request-ValidateUpdateListItem/td-p/...

 

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 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,587)