cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnonyMouse
Helper I
Helper I

Clear DateField and Lookup Column value

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?

15 REPLIES 15

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!

Anonymous
Not applicable

i_power
Advocate II
Advocate II

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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,201)