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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Clear Closed Date if O...
Power Apps
Answered

Clear Closed Date if Open Status

(0) ShareShare
ReportReport
Posted on by 233

I have a combobox DataCardValue1 that has an Open or Closed Value. If the value is Open it hides DataCardValue2 which is a Date Picker.

If they switch the record back to open I need to remove/reset the date entered in DataCardValue2. Is there a way to do this?

Thanks.

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @kbashaw,

     

    The following code in the DefaultDate property of DataCardValue2 should do the trick:

    If(
     DataCardValue1.Selected.Value = "Closed",
     Parent.Default
    )

    It will patch a blank value and overwrite any previously saved date value once they submit the form with status = "Open". (Given that the Update property of DataCard2 is still the default DataCardValue2.SelectedDate)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • kbashaw Profile Picture
    233 on at

    The Update property of DataCard2 is still the default DataCardValue2.SelectedDate

    I tried it but it still doesn't clear the previous date.

  • kbashaw Profile Picture
    233 on at

    It looks like it's  removing it from the datacard but not in Sharepoint. When I tried:

    If(
    DataCardValue1.Selected.Value = "Open",
    Parent.Default
    )

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @kbashaw,

     

    In the If statement, DataCardValue1.Selected.Value should be equal to "Closed" (see initial code). If you want to use 'is equal to Open' try:

     

    If(
     DataCardValue1.Selected.Value = "Open",
     //If open, reset to blank
     Blank(),
     //Else display the saved value
     Parent.Default
    )
  • kbashaw Profile Picture
    233 on at

    I've tried both ways and it still doesn't clear the date. I am able to change between Open, Close change the dates and the patching works. The data field just won't clear.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @kbashaw ok I may have found the issue:

     

    In addition to my previous code in the Default property, could you add the following code to the OnChange of DataCardValue1:

    Reset(DataCardValue2)

     

  • kbashaw Profile Picture
    233 on at

    I added the OnChange code and tried it with both of the variations above. It still won't clear the date. I also tried a few other records.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @kbashaw,

     

    I unfortunately am unable to recreate the issue. I tested via the following steps:

     

    1. Save a record with a date
    2. Adjust the record status to 'Open'
    3. Step 2 clears the DataCardValue2's date
    4. I save the data by using the SubmitForm function
    5. The date in my SharePoint list for that record is cleared
  • kbashaw Profile Picture
    233 on at

    I can't use a SubmitForm function, I need to patch this data.  Although I do have a SubmitForm button just to test what will update and the date didn't update with that one either.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @kbashaw,

     

    Thank you for the additional information!

     

    Is Formula-error level management turned on in your app settings? In recent apps this will probably be on by default. Should this be off, that could explain the issue we are facing.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard