cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Reset Date in Datepicker (in a form) with Button

My app shows the date at which a client was invoiced inside a date picker on a form and that date is stored in a Sharepoint list.

 

I would like to have a button that resets the datepicker to a blank value.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Reset Date in Datepicker (in a form) with Button

Hi @zalandoe ,

 

You have to add a Reset button in the DatePicker DateCard, if you want to only reset the datepicker control instead of the whole form.

And please refer to the following steps

1. Unlock the DatePicker DateCard, and Add a button named Rest in it.

2. Set OnSelect property of button as below

UpdateContext({resetdate:true});Reset(DataCardValue1)

3. Set DefaultDate property of DatePicker as below

If(resetdate,Blank(),Parent.Default)

4. Set OnSuccess, OnRest, OnFailure property as below to causes the default value to be displayed the next time the form is opened

UpdateContext({resetdate:false})

Once click the reset button, the DatePicker would return blank value.

If you also want to update the Blank value of DatePicker to sharepoint list, you also need to turn on a New Feature setting: Formula-level error management

You can find it from File – App Setting – Advanced Setting – Formula-level error management.

Annotation 2019-08-23 142905.pngAnnotation 2019-08-23 143033.png

Best regards,

Sik

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User
Dual Super User

Re: Reset Date in Datepicker (in a form) with Button

Hi @zalandoe 

 

all about date picker by April Dunnam

https://www.sharepointsiren.com/2019/05/powerapps-restricting-date-picker-options/

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Community Support
Community Support

Re: Reset Date in Datepicker (in a form) with Button

Hi @zalandoe ,

 

You have to add a Reset button in the DatePicker DateCard, if you want to only reset the datepicker control instead of the whole form.

And please refer to the following steps

1. Unlock the DatePicker DateCard, and Add a button named Rest in it.

2. Set OnSelect property of button as below

UpdateContext({resetdate:true});Reset(DataCardValue1)

3. Set DefaultDate property of DatePicker as below

If(resetdate,Blank(),Parent.Default)

4. Set OnSuccess, OnRest, OnFailure property as below to causes the default value to be displayed the next time the form is opened

UpdateContext({resetdate:false})

Once click the reset button, the DatePicker would return blank value.

If you also want to update the Blank value of DatePicker to sharepoint list, you also need to turn on a New Feature setting: Formula-level error management

You can find it from File – App Setting – Advanced Setting – Formula-level error management.

Annotation 2019-08-23 142905.pngAnnotation 2019-08-23 143033.png

Best regards,

Sik

View solution in original post

Highlighted
Frequent Visitor

Re: Reset Date in Datepicker (in a form) with Button

This worked perfectly! Thank you so much!

Highlighted
Advocate II
Advocate II

Re: Reset Date in Datepicker (in a form) with Button

Hi,

This works as explained in my test App (to test the reset) but when I copied the code over to my production App I started to get really odd behaviour.

 

After spending several hours trying to figure out why my production App failed I found that enabling "Formula-level error management" kills your connection to Flow (I use Flow to pull data from a stored procedure on Azure SQL database).

 

Not sure if there is a fix for this - anyone had the same problem and fixed it?

 

If not it looks like I'll need build a separate app just to clear dates (back to NULL).

 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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