cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Re: Clearing out people picker field

@sjcitpro,

Yeah, that's how I was doing it before I started down this path. However, when I started rebuilding my App from scratch, I decided I wanted to avoid the Flow. In my previous build, I was relying on rough-guess timers to be able to accurately navigate screens based on Flow successes/failures - perhaps unnecessarily?

Thankfully my Person field is a People field... again, hopefully we get general availability of patching-to-null soon.

Cheers,

Josh

Highlighted
New Member

Re: Clearing out people picker field

Hi josh not sure why it didn’t work for me, the patch to people field looks for a record not a table so it didn’t work but just changing your code a little it worked a charm! Thanks

Patch(testlist,
ID:ItemID,{personfield:Lookup(blankperson,Claims=blank())}
)

Works a treat
Highlighted
Anonymous
Not applicable

Re: Clearing out people picker field

In case anyone finds their way here. I think they made some changes to PowerApps that now allow the Blank() function to patch a blank value to people picker fields. You do need to have the experimental feature turned on though.

 

In my case, I was trying to clear the value from a single select People Picker in order to return an item to a general queue where it could be reclaimed by another. I was working with the items inside of a gallery, so you may have to alter it to fit what you need. What ended up working was:

 

Patch(YourListName, ThisItem, {PeoplePickerFieldName: Blank()})

 

This cleared the people picker value and reset it to blank

Highlighted

tested Re: Clearing out people picker field

When i tested with your approach i am geeing the below error
The type of argument AssignedTo does not match the expected type record.Found type is table

Highlighted
Advocate V
Advocate V

Re: tested Re: Clearing out people picker field

Hey @santukondapally,

 

That error message appears when you try to patch a SharePoint person column that supports entry of a single person using a table-based "BlankPeople" format (I've finally gone back to clarify in my old posts that they are "BlankPeople" not "BlankPerson" patches).

 

In your case, you may need "AssignedTo" to remain as a single person field, which means that for now, you will need to rely on enabling the Experimental Feature shown in the first part of my other post here (remember to reload your app editor after turning it on) - https://powerusers.microsoft.com/t5/Building-Power-Apps/Clearing-out-people-picker-field/m-p/262739/...  

Once that feature is enabled, your patch should work with something along these lines:

Set(
    BlankPerson,
        {
            Claims: Blank(),
            DisplayName: Blank(),
            Email: Blank(),
            Department: Blank(),
            Picture: Blank(),
            JobTitle: Blank()
        }
);

 

Patch(
        'Your list',
        {ID: ItemID},
        {
	    AssignedTo: BlankPerson
        }
    )

 Be sure to note that this "BlankPerson" variable does not have the Table function wrapping its contents, meaning it is now a "record" and the error won't occur when trying to patch "AssignedTo". As far as I know, enabling the "Formula-level error management" Experimental Feature is still necessary for SharePoint to clear the field as expected.

 

Hope this helps!

Josh

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,696)