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

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
PowerApps Staff LauraOnu
PowerApps Staff

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
PowerApps Staff LauraOnu
PowerApps Staff

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

faiz
Level: Power Up

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.

SergiP
Level: Powered On

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
Django
Level: Powered On

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)

 

Django
Level: Powered On

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)
rajmilansinh
Level: Powered On

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 ?

TheMan
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,839)