cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Clearing out people picker field

I've customized the default form for a SharePoint list using PA - the form is used for people in my organisation to book slots on a training course. It's a simple list and users can only edit two fields; Name (people picker) and Status (DDL either Vacant or Booked). Everything works well until someone wants to cancel their slot and remove their name. When clearing out the Name field and hitting Save, the field is repopulated with the name that was originally saved there. The name can be overwritten with a new value, but it can't seemingly be deleted. Has anyone else experienced this or found a way to solve it? Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Clearing out people picker field

Hi @MarkP,

Could you please share a bit more about your issue?

I have made a test, and the issue is confirmed on my side. It seems that if you clear value within the Person field (Combo Box control), PowerApps would think you don't make any changes to the Person field.

The user @AnonyMouse has faced same 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 have post this issue to my product team, if the issue is solved, I would reply here.

 

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

24 REPLIES 24
Highlighted
Community Support
Community Support

Re: Clearing out people picker field

Hi @MarkP,

Could you please share a bit more about your issue?

I have made a test, and the issue is confirmed on my side. It seems that if you clear value within the Person field (Combo Box control), PowerApps would think you don't make any changes to the Person field.

The user @AnonyMouse has faced same 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 have post this issue to my product team, if the issue is solved, I would reply here.

 

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

Highlighted
Advocate II
Advocate II

Re: Clearing out people picker field

Got any update?

 

I can't clear the value from a person field from SPL via PowerApps "OnSelect" event and I can't do it.

Ex.:

AssignedTo : Dexter, John

 

Patch(
MySPL,
SPL_SelectedRecord,
{
AssignedTo: Blank(),
strAssignedToEmail: ""
}
);

 

Running that code clear the strAssignedToEmail field but doesn't do anything to the AssignedTo field (which is a person or group field)

 

It doesn't give any error...

 

Some help or update on issue about Clearing out people picker field from SLP would be appreciated.

Highlighted
Regular Visitor

Re: Clearing out people picker field

Hi Kris,

 

Thanks for the response...

 

There's not really much else I can share about this one, it's a simple SPL with customized PA form. We need users to be able to clear their names from the Person field and save it back to the list if they are no longer able to attend a session they had booked onto.

 

I haven't tested whether this same issue is replicated in a canvas app...

 

All the best,

Mark

 

 

Highlighted
Advocate V
Advocate V

Re: Clearing out people picker field

Hi all, I found a way to clear Person/People picker fields that doesn't rely on experimental features, nor a Flow, so I thought I'd surface it here. I'm not yet sure if the same approach will work for DateField, LookUp or Group Picker, but hopefully!

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" "BlankPeople" variable that is manually shaped as a single tabular, blanked-out Person People record for the SP PersonPeople/Group (multiple selection) 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()}))
Set( BlankPeople, Table( { 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

Highlighted
Super User
Super User

Re: Clearing out people picker field

@joshnystrom 

Awesome find!!!

Yes, this works on Lookup columns as well (Id:Blank(), Value:Blank())

No luck on choice or date columns so far...

 

Good work!!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Advocate V
Advocate V

Re: Clearing out people picker field

Thanks for confirming this for LookUp columns @RandyHayes! If I get a chance, I'll see if I can rework this for Choice and/or Date columns as well and keep this (and some of the other related threads) posted with my results.

 

Cheers!

Highlighted
Advocate V
Advocate V

Re: Clearing out people picker field

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

You can reliably clear People (multi-select person picker), Choice and Lookup (but still not Date) fields as follows:

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

Set(
    BlankPeople,
    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},
        {
	    PeopleField: BlankPeople,
            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

 

 

Highlighted
Super User
Super User

Re: Clearing out people picker field

@joshnystrom 

SWEET!!  Great work!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Helper III
Helper III

Re: Clearing out people picker field

How do you use BlankPerson in the Patch? I tried this without any luck, Owner being the Sharepoint Person or Group Field.

 

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

Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner:BlankPerson})

 

Also tried:

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

Patch(Hardware,First(Filter(Hardware,ID=ThisItem.ID)),{Owner:BlankPerson})

 

 

 

 

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,401)