Solved! Go to Solution.
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
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
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
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
Hi there,
This is a great post. I've been able to use your concept to run the patch function as part of an OnSelect code related to a button on the edit form. This works fine and clears my value for the selected record. I'm a bit new to PowerApps though and was wondering if there's a clean way to run it as part of the update code for when the edit form is actually being saved? In that way run the regular update statements as part of the bound data and then following that detect that the passed value was a blank and as a result run the patch? Seems like this should be obvious and I'm just missing something!
Any updates are helpful!
Nick
User | Count |
---|---|
233 | |
109 | |
94 | |
59 | |
29 |
User | Count |
---|---|
293 | |
126 | |
106 | |
62 | |
57 |