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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset date time field ...
Power Apps
Unanswered

Reset date time field to blank on toggle set to false

(0) ShareShare
ReportReport
Posted on by

Hi all,

thought this would be simple but having an issue with setting a date time field to blank in a canvas app. I’m working on a canvas app a previous developer has worked on 

We have a toggle called DOB  not provided and on check sets a variable called locDOB to Today() and another variable called locDefaultSet to true. On the uncheck of the toggle he sets locDefaultSet to false.

On the default date property of the date time field he has if(locDefaultSet=true,locDOB,, Parent.Default)

Now I need to clear the date and time field when toggle is false. So I tried replacing the Parent.Default with Blank(). However if a person doesn't set the toggle to true and enters a date and saves, when they come back to the screen the date time field is blank. The idea is if someone doesn’t provide a date and sets toggle to true today’s date is set automatically. However, if someone comes back in after the field value is saved and sets the toggle to false I need to clear it out.

Categories:
I have the same question (0)
  • Verified answer
    victorcp Profile Picture
    2,350 Moderator on at

    Hi, hope you are doing well

    try this:

    On the 'OnVisible' of the screen, set the variable to blank, like this:

     

    Set(locDefaultSet, Blank())

     

    Now change the default date to this:

     

    If(
     locDefaultSet,
     Today(),
     IsBlank(locDefaultSet),
     Parent.Default
    )

     

    Hope it helps 🙂

  • Darren137227 Profile Picture
    on at

    Thanks victorcp, that worked a treat

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard