web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ResetForm not clearing...
Power Apps
Unanswered

ResetForm not clearing Date control selection

(1) ShareShare
ReportReport
Posted on by 716 Moderator
I have an icon that Cancels a user's edits on a form by doing a ResetForm(frmRequest).
 
The form visually resets but I know that it's leaving underlying data selections in place.
I discovered this in an effort to ensure a date control only allows future dates.
 
An If checks DatacardDate.Default and DateControl.SelectedDate to determine if either are wrong and then the save button doesn't work. Although I realize as I type this I'll have to fix that logic since tomorrow becomes yesterday eventually and my DatacardDate.Default will be in the past.
At any rate, this logic works correctly and the Save icon is disabled so you can't proceed.
If you fix it you can submit the form and all is good.
 
The cancel icon however, resets the form visually but I know that DateControl.SelectedDate is still the old date because the icon is still disabled after doing ResetForm.
So how do I clear DateControl and where should I do it?
 
I can't Reset the control within a form from outside which I tried first.
 
Should or do I need to, add another control inside the form that I can use to clear and cancel instead of outside where I have the Save and Edit icons/controls?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    52,970 Super User 2025 Season 2 on at
    ResetForm not clearing Date control selection
    Hi
     
    At the top, please always explain your issue first, reading through lots of stuff before I even know the ask(if its even clear) is a pain to then back track to details given before the problem was.
     
    Scenario:
     
    Issue:
     
    Details:
     
    :-)
     
    Now do this please.
     
    1. Create a Variable in your Screens OnVisible
    Set(_ResetDate, false);
     
    2. In your Date Control, put this in the Reset property
    _ResetDate 

    3. When you want to clear it do this (in any code)
    Set(_ResetDate, true);
    Set(_ResetDate, false);
     
    This will reset it, althoguh it WILL reset it to the default selected date, if you have one
  • Suggested answer
    Ravindra Jadhav Profile Picture
    342 Moderator on at
    ResetForm not clearing Date control selection
    Check default property of date control or data Card, i think you hardcode some value there 
  • DCHammer Profile Picture
    716 Moderator on at
    ResetForm not clearing Date control selection
    Thanks FLMike. I tried multiple times to mark your reply as an Answer but it never saves. Sorry I can't give you credit.
    And thanks for the guidance on making posts.
    The easier it is to read, the more likely I'll get help.
    Happy to do as you suggest.
  • DCHammer Profile Picture
    716 Moderator on at
    ResetForm not clearing Date control selection
    @FLMike Well, I finally managed to mark your comment the answer. Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard