I have a datefield and lookup column in my form. In the EditForm, after the user clears the datefield column and lookup column to an empty value and save the form, in sharepoint, it still retains the old value. How can I set these fields back to null?
Solved! Go to Solution.
Hey @oliverlpgmail, sorry, I never got back to this thread to fill in some of the more recent details:
My "BlankPerson" variable from above would be better named "BlankPeople".
BlankPerson should instead look like:
Set( BlankPerson, { Claims: Blank(), DisplayName: Blank(), Email: Blank(), Department: Blank(), Picture: Blank(), JobTitle: Blank() } );
You have to use "BlankPerson" when your Person/Group field is set to single-select, and "BlankPeople" [with the Table() wrapper] when it is set to multiple-selections.
Hope that clears up your error!
Josh
Hi Josh,
Thanks for your response. It didn't work for me.
In my case the solution was to activate one of the "Experimental features". "Formula level error management". I found it in a blog by Greg Lindhorst. Then the SubmitForm is able to empty a User field. If I want to use a PATCH then I simply do this:
Patch(
Bokning;
{ID: _selected.ID};
{Person: Blank()}
);;
Hi Oliver,
I was trying to clear the person field and the above solutions with patching with Blank() values to user attributes din't work for me.
Just by activating the experimental feature "Formula Level error management" as you suggested, both the below approaches of clearing the person field are working
1. Form submit with a cleared person choice field
2. Patch (Source,Item,{PersonColumn:Blank()})
Thanks a lot!
Cheers!
This worked for me - handling nulls for both dates and lookups.
(Almost a year later) I believe these solutions do not work. I tried Patch with Blank()s and with a BlankPerson variable and I couldn't find the experimental features setting.
Moreover, my ComboBox is in a gallery and as soon as I try any of these solutions, it creates some endless loop or something that causes my app to keep spinning and hanging with the "Please wait..." message. It takes hours trying to get control of the app again and usually what I have to do is delete the ComboBox altogether.
Looks like the only real "solution" is to avoid this with workarounds 😞
I had the same issue and also fixed with the Experimental feature. Hopefully it does not change or gets deprecated.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
193 | |
71 | |
49 | |
48 | |
20 |
User | Count |
---|---|
250 | |
128 | |
84 | |
76 | |
74 |