cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Power Automate
Power Automate

Clear Data Values (leaving them blank)

While using the app, how do you clear the date value? For example, the visit date was correctly entered as 8/1/2016, and the end user wants to clear that date because no one was visited yet. (I can't seem to select the date to delete it, and there is no 'x' at the right of the field.)

 

Thank you,

Audrie

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Clear Data Values (leaving them blank)

To allow users to clear the date (empty the DatePicker)

Select datepicker control and sets its IsEditable property to true

Now the user can delete the value using the keypad.

 

To reset the datePicker to the default value (set via Date.DefaultDate)

1. Add a button control.

2. Select the datepicker control

3. Set its Reset property to Button1.Pressed

Known issue: if default value is null, reset is not working properly, fix coming soon. 

ResetDatePicker.jpg

 

 

Please let meknow if options above works for the scenario below, happy to further help.

Thank you,

Laura

View solution in original post

7 REPLIES 7
Highlighted
Power Apps
Power Apps

Re: Clear Data Values (leaving them blank)

To allow users to clear the date (empty the DatePicker)

Select datepicker control and sets its IsEditable property to true

Now the user can delete the value using the keypad.

 

To reset the datePicker to the default value (set via Date.DefaultDate)

1. Add a button control.

2. Select the datepicker control

3. Set its Reset property to Button1.Pressed

Known issue: if default value is null, reset is not working properly, fix coming soon. 

ResetDatePicker.jpg

 

 

Please let meknow if options above works for the scenario below, happy to further help.

Thank you,

Laura

View solution in original post

New Member

Re: Clear Data Values (leaving them blank)

Hi I observed that if user enters a date and saved it. LAter on decided to remove the date and save it the old date still remains.

Highlighted
Advocate II
Advocate II

Re: Clear Data Values (leaving them blank)

This proposed solution doesn't work. The reset = true doesn't clear the date field in the selected record.

So far the only solution that I've found to work (unfortunately) is patching a new record with all exact same fields than the original one but the date I want to clear and then removing the original record.

hope it helps!

Highlighted
Kudo Collector
Kudo Collector

Re: Clear Data Values (leaving them blank)

For people in search for the functionality that variables (dates) should be emptied / nullified without the help of a button I created the following workaround.

 

I needed to empty the default value of a date picker but also have that date picker populated with a date based on other information.

Scenario: when someone opens the date picker of a pregnancy estimated due date --> I want the date picker to show the month of 40 weeks from now (just because I don't want pregnant women to have to click too much).

  1. In the date picker I added a formula in the OnSelect property = 
    If(IsBlank(DateEstimated.SelectedDate),ClearCollect(CollectionDateEstimated,{CollectedDateEstimated: DateAdd(Now(),280,Days)}))
  2. Of that same date picker we can now add a Default date equal to the collected date = 
    Last(CollectionDateEstimated).CollectedDateEstimated
    So when someone opens the date picker - the month of 40 weeks from now is opened

This way --> whenever the date picker needs to be emptied this can be achieved by having an (onChange or onSelect event) clearing the collection with the formula = 

Clear(CollectionDateEstimated)

 

Highlighted
Kudo Collector
Kudo Collector

Re: Clear Data Values (leaving them blank)

For people in search for the functionality that variables (dates) should be emptied / nullified without the help of a button I created the following workaround.

I needed to empty the default value of a date picker but also have that date picker populated with a date based on other information. Scenario: when someone opens the date picker of a pregnancy estimated due date --> I want the date picker to show the month of 40 weeks from now (just because I don't want pregnant women to have to click too much).

  1. In the date picker I added a formula in the OnSelect property = 
    If(IsBlank(DateEstimated.SelectedDate),ClearCollect(CollectionDateEstimated,{CollectedDateEstimated: DateAdd(Now(),280,Days)}))
  2. Of that same date picker we can now add a Default date equal to the collected date = 
    Last(CollectionDateEstimated).CollectedDateEstimated

    So when someone opens the date picker - the month of 40 weeks from now is opened

This way --> whenever the date picker needs to be emptied this can be achieved by having an (onChange or onSelect event) clearing the collection with the formula = 

Clear(CollectionDateEstimated)
Highlighted
Advocate III
Advocate III

Re: Clear Data Values (leaving them blank)

@LauraOnu  is there any update on this issue? 

When reset function will be fixed or there is any other method to clear the date value ?

Highlighted
Regular Visitor

Re: Clear Data Values (leaving them blank)

Use the Reset() function on a button.

Reset(<DateInputField>);

 

This is how I used it on a back/cancel button, and should use it on the submit button after it submits to clear the form for next time.

 

Set(_showInstallPopup, false);
Set(_resetInstallPopupInput, true);
Reset(InstallPopupInputEPC_DS);
Back()

 

The reset Property via a variable is broken for the DateInputField

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,883)