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 / Update 'Date Picker' w...
Power Apps
Answered

Update 'Date Picker' with today's date, if it is empty and another combobox option is selected

(0) ShareShare
ReportReport
Posted on by 256

Running in powerapps with a form in edit mode, connecting to a backend Sharepoint/Microsoft List as the datasource. I have a field in List called 'Status' which is a type 'choice' and has 5 selectable fields to choose from.  When I use the combobox on the form and click on Status pulldown and then select 'close', I'd like for the Date Picker field to then be visible and update the default date to the current date (no time, just the day/month/year).

 

However, if the form loads an existing entry that already has 'closed' chosen in the form and a pre-defined date, I'd like for it to keep the previously entered date and not update the date to today.

 

Any thoughts on how to accomplish this? I keep trying to use If(IsBlank(CloseDate.SelectedDate), ThisItem.CloseDate = Now()) but it's not working.

 

Thanks in advance!

Categories:
  • Verified answer
    Hassan_SZ_365 Profile Picture
    542 on at

    Hi  , 

     

    Visibility of Date Picker: Set the Visible property of the Date Picker to:

    DataCardValue_Status.Selected.Value = "close"

    This ensures that the Date Picker is only visible when 'close' is selected in the 'Status' combobox.

     

    Default Date Logic: For the DefaultDate property of the Date Picker, use:

    If(DataCardValue_Status.Selected.Value = "close" && IsBlank(ThisItem.CloseDate), Today(), ThisItem.CloseDate)

     This expression checks if 'close' is selected and if the CloseDate field is blank. If true, it sets the default date to today. Otherwise, it retains the existing date.

     

    Remember, DataCardValue_Status and ThisItem.CloseDate are placeholders. Replace them with the actual names of your controls and fields in the app.

     

    Best Regards,

    Hassan Raza

    @galos

  • galos Profile Picture
    256 on at

    Thank you @Hassan_SZ_365 , this worked perfectly

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
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard