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

Clear people picker box in SharePoint list

I have built a simple inventory tracking app using a SharePoint list.  I have a field in the list called "Checked Out To" that is a people picker to select a user.  In the app, I have a screen for "Check In" and I want to clear the "Checked Out To" field.  For the combo box on the form, I tried deleting the values in "Default" and "DefaultSelectedItems" properties, and it looks like it works (combo box says "Find Items").  But when I submit the form in the app, the value in the list doesn't change (still shows being checked out to the same person).  Thanks in advance for your help.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Clear people picker box in SharePoint list

HI @RPRockman,

Do you want to clear Person column value within Edit form of your app?

The user @AnonyMouse has faced similar issue with you, please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Clear-DateField-and-Lookup-Column-value/m-p/1...

I also agree with @OneThing's thought almost. If you don't provide a value for the People picker box (a Combo Box control) when you edit a record within the Edit form, PowerApps Edit form would think that you don't make any changes to the People Picker column (Person column), so the old value within the Person column would not be changed.

Currently, I afraid that there is no way to clear the People picker box value (Person column, decorated as a Combo Box control) within the Edit form in PowerApps.

Note: I  don't the Blank() function could achieve your needs.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

manojmittal
Level: Powered On

Re: Clear people picker box in SharePoint list

Getting same and found the workaround. Hope it will help

 

Do the below settings and It allow to save people picker as blank values.

PowerApp_SetNullValue.pngReference:- https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

View solution in original post

9 REPLIES 9
OneThing
Level 8

Re: Clear people picker box in SharePoint list

Hi @RPRockman,

 

When you are clearing the Default value you are telling powerapps not to use the value so it displays as empty. When you are submitting the form you have nothing in your field to write back so sharepoint keeps the original data.

 

I think you would need to set the default to something like Blank() which will set the field to null.

 

I can't test this on sharepoint at the moment, but here is a link with more information https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty

 

Thanks,

Nicky

Community Support Team
Community Support Team

Re: Clear people picker box in SharePoint list

HI @RPRockman,

Do you want to clear Person column value within Edit form of your app?

The user @AnonyMouse has faced similar issue with you, please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Clear-DateField-and-Lookup-Column-value/m-p/1...

I also agree with @OneThing's thought almost. If you don't provide a value for the People picker box (a Combo Box control) when you edit a record within the Edit form, PowerApps Edit form would think that you don't make any changes to the People Picker column (Person column), so the old value within the Person column would not be changed.

Currently, I afraid that there is no way to clear the People picker box value (Person column, decorated as a Combo Box control) within the Edit form in PowerApps.

Note: I  don't the Blank() function could achieve your needs.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

RPRockman
Level: Powered On

Re: Clear people picker box in SharePoint list

Thanks, Nicky and Kris for your response.  Kris, you were correct, the Blank() idea didn't work.  I will submit something to the idea board so it can be fixed.  Bummer!  Cheers.

manojmittal
Level: Powered On

Re: Clear people picker box in SharePoint list

Getting same and found the workaround. Hope it will help

 

Do the below settings and It allow to save people picker as blank values.

PowerApp_SetNullValue.pngReference:- https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

View solution in original post

joshnystrom
Level 8

Re: Clear people picker box in SharePoint list

Hi all, I found a way to do this that doesn't rely on the experimental features, nor a Flow, so I thought I'd surface it here.

My current understanding of my approach makes a few assumptions (I'm not certain whether they are integral to its use):

-You are treating this like a "Complex" data update and are therefore using Patch statements to merge into the existing SP List item
-Your app has a way to detect when the person-picking control was left blank so that you can conditionally change which Patch statement is being executed

-You are using the out-of-the-box people picker or can otherwise tweak my approach to match a "valueless" Person record

All I've done is prep a "BlankPerson" variable that is manually shaped as a single, blanked-out Person record for the SP Person/Group field, as follows:

Set(BlankPerson,Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:Blank(),DisplayName:Blank(),Email:Blank(),Department:Blank(),Picture:Blank(),JobTitle:Blank()}))

When Patching with this as my payload when the People picker control is left blank, I've been able to Clear the corresponding field on my SP List item.

 

Hope this helps someone!

Josh


 

E: In this thread - https://powerusers.microsoft.com/t5/General-Discussion/Clearing-out-people-picker-field/m-p/249368/h... - RandyHayes indicated that this approach is working for LookUp fields as well.

joshnystrom
Level 8

Re: Clear people picker box in SharePoint list

Okay, I've done more investigation on what is possible with this approach and here is a (hopefully) simple rollup:

You can reliably clear Person, Choice and Lookup (but still not Date) fields as follows:

Set each corresponding "blank" variable (Person is a Table, the others are individual Records)

Set(
    BlankPerson,
    Table(
        {
            Claims: Blank(),
            DisplayName: Blank(),
            Email: Blank(),
            Department: Blank(),
            Picture: Blank(),
            JobTitle: Blank()
        }
    )
);
Set(
    BlankChoice,
        {
            Id: -1,
            Value: Blank()
        }
);
Set(
    BlankLookup,
        {
            Id: -1,
            Value: Blank()
        }
)

And merge-patching the target list item like so:

Patch(
        'Test List',
        {ID: ItemID},
        {
	    PersonField: BlankPerson,
            ChoiceField: BlankChoice,
            LookupField: BlankLookup
        }
    )

That's all I have so far. I still haven't tested Groups but I suspect they would work fine.

Good luck!

Josh

tftda23
Level: Powered On

Re: Clear people picker box in SharePoint list

@joshnystrom this would be great if I could get it to work 😮

I am currently receiving the following on my patch though:

The type of this argument 'AssignedTo' does not match the expected type 'Record'. Found type 'Table'.
The function 'Patch' has some invalid arguments.

Any ideas?

 

tftda23
Level: Powered On

Re: Clear people picker box in SharePoint list

Ah looks like the table is for where the person field allows more than one selection. Still cant update wherby allo multiple choice is disabled.

Highlighted
LavaJones
Level: Power Up

Re: Clear people picker box in SharePoint list

Thanks Manojmittal! This worked for me. I can now clear the Person column.  

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

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