cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
landonjochim
Resolver II
Resolver II

Clearing a Person field in a SharePoint - Send an HTTP Request

I have seen a few posts on this and there is no easy way to clear a 'Person or Group' field within Power Automate so that the flow will clear out this field so if any Person was in this field, they would be cleared. I know that you need to send an HTTP request to do this. I have tried to follow a few other steps, but cannot get it working. Still getting an error on this action within my flow. Here are the details and then my current 'Send an HTTP Request' Action.

 

SharePoint List Name: "PurchaseRequest_PurchaseRequestList"

Person Column: 

  • Internal Name: "AssignedTo"
  • Name: "Assigned To"

Screenshot 2021-04-27 163949.png

 

I am sure I am just missing something, but I cant seem to figure out what that is. Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
landonjochim
Resolver II
Resolver II

I had a handful of issues, but here is my working solution:

Site Address: <Site URL>

Method: POST

Uri: _api/web/lists/GetByTitle('<Form Library Name>')/items(<Unique Identifier of the Item>)

Header:

{

"Accept": "application/json;odata=verbose",

"Content-Type": "application/json;odata=verbose",

"X-HTTP-Method": "MERGE",

"IF-MATCH": "*"

}

Body:

{

"__metadata": {

"type": "SP.Data.<Form Library Name>ListItem"

},

"FieldNameId": "-1"

}

 

My issue was that because my list had an _ in the name, the Body JSON wouldnt recognize this and I had to replace the _ with PurchaseRequest_x005f_PurchaseRequestListListItem

 

landonjochim_0-1619645849789.png

 

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @landonjochim 

 

Please see this article

 

How to update the SharePoint People Picker Field using Power Automate - Collab365

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
landonjochim
Resolver II
Resolver II

I had a handful of issues, but here is my working solution:

Site Address: <Site URL>

Method: POST

Uri: _api/web/lists/GetByTitle('<Form Library Name>')/items(<Unique Identifier of the Item>)

Header:

{

"Accept": "application/json;odata=verbose",

"Content-Type": "application/json;odata=verbose",

"X-HTTP-Method": "MERGE",

"IF-MATCH": "*"

}

Body:

{

"__metadata": {

"type": "SP.Data.<Form Library Name>ListItem"

},

"FieldNameId": "-1"

}

 

My issue was that because my list had an _ in the name, the Body JSON wouldnt recognize this and I had to replace the _ with PurchaseRequest_x005f_PurchaseRequestListListItem

 

landonjochim_0-1619645849789.png

 

kcg633755
Helper II
Helper II

I have followed the above but I am still finding my HTTP Request is failing.


"status"
: 400,
"message": "An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.\r\nclientRequestId: c0f2f924-db36-4e41-a54b-66541721533a\r\nserviceRequestId: 971c26a0-e0e8-3000-ac9e-869adb580c2d",

This is how it appears from my inputs...
Screenshot 2022-03-03 at 11.51.54.png





I am assuming it is something to do with the space in the title of the list.
So my list title = Build Projects
Writing is as Build%20Projects appears to work in the Uri but the type section of the body seems to not like any combination I have tried...

SP.Data.Build%ProjectsListItem
SP.Data.BuildProjectsListItem
SP.Data.Build ProjectsListItem
SP.Data.Build_x0020_ProjectsListItem

Any ideas what I am getting wrong.

Make sure there are two underscores before "metadata" in the Body. I think also in the Body you need to use "_x0020_" for the space, so SP.Data.Build_x0020_ProjectsListItem.

Also, I think four you it should be:

"SendtoStringId":"",

"SendtoId":-1

Hi @landonjochim 

 

This not working to me. Can you help me to capture what was wrong there.

 

sachk1_0-1663845386508.png

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 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 (4,922)