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

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
Community Support Team
Community Support Team

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

20 REPLIES 20
Community Support Team
Community Support Team

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
systemcrash
Level: Powered On

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.

MarkP
Level: Powered On

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

 

 

joshnystrom
Level 8

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" 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

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.
joshnystrom
Level 8

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!

joshnystrom
Level 8

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 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

 

 

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.
sjcitpro
Level: Powered On

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 402 members 4,678 guests
Please welcome our newest community members: