cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
imran7799
Level: Powered On

Clean value in people fields

I was trying to build a flow that updates couple of people fields. I found an issue during the testing that Update Item event does not update the field if no value is provided. I could not find any event to set this field to null. I tried passing null extression value in update item but that returns an error.

 

I did some research and came accorss one article to suggest to use REST API to clear the value. I am going to try that but just wondering if there is any better way to reset this fields ?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Clean value in people fields

Hi @imran7799 ,

 

Person fields can be updated in two cases. Depending on your settings for this field:

50.PNG

 

The first case is to use REST API to update field values for “Not Allow multiple selections”, which means that Person field contains only one user.

 

I did a test on my side and created a field of Person type with a field named Single.

By setting StringId of the corresponding field to null and setting the Id to -1, we can clear the value of this field. Specific details can refer to a similar Thread.

Body:

{ '__metadata': { 'type': 'SP.Data.ListNameListItem' }, 
'ColumnNameStringId': '',
'ColumnNameId':-1}

Image reference:

48.PNG

For more details about SharePoint REST API, please refer to following link:

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-re...

 

The second case is for Allow multiple selections, which allows multiple user values in the field value.

Because the value of this field is an array, consider using an empty array variable to update this field.

Image reference:

49.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Clean value in people fields

Hi @imran7799 ,

 

Person fields can be updated in two cases. Depending on your settings for this field:

50.PNG

 

The first case is to use REST API to update field values for “Not Allow multiple selections”, which means that Person field contains only one user.

 

I did a test on my side and created a field of Person type with a field named Single.

By setting StringId of the corresponding field to null and setting the Id to -1, we can clear the value of this field. Specific details can refer to a similar Thread.

Body:

{ '__metadata': { 'type': 'SP.Data.ListNameListItem' }, 
'ColumnNameStringId': '',
'ColumnNameId':-1}

Image reference:

48.PNG

For more details about SharePoint REST API, please refer to following link:

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-re...

 

The second case is for Allow multiple selections, which allows multiple user values in the field value.

Because the value of this field is an array, consider using an empty array variable to update this field.

Image reference:

49.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,135)