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 / Add todays date to Tex...
Power Apps
Answered

Add todays date to TextBox if ComboBox is changed

(0) ShareShare
ReportReport
Posted on by 138

Hi 

 

I have a combobox on a form with Items for "Requested", "In Progress", "Complete" etc... 

 

I also have a Date Picker field to show the "Date Completed" 

 

I would like to add code so when "Complete" is selected from the combobox, today's date is added to the date picker field. Date needs to show in UK format. 

 

Likewise, if the combobox is changed to the other items, then remove the date from the date picker

 

Any help appreciated 🙂

Thanks,

Categories:
I have the same question (0)
  • Verified answer
    stephenjcarr Profile Picture
    138 on at

    Scratch this. Solved it as soon as I posted. 

     

    I added this to the OnChange property of the ComboBox 

     

    If(
    DataCardValue2.Selected.Value = "Complete",
    UpdateContext({ CompletedDate: Today() }),
    UpdateContext({ CompletedDate: Blank() })
    )


    Then I added the variable "CompletedDate" to the Default Date property of my date picker 

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @stephenjcarr ,

     

    Thanks for your feedback. Glad to hear you solved this problem.

     

    I suggest you set the OnSelect property for the combo box to ‘Reset(DatepickerName)’ , to ensure that the logic of automatically modifying the date is valid after the user manually selects it.

     

    In addition , you could set the datepicker's Format property to change the format.

    vbofengmsft_0-1688621547132.png

     

    Best Regards,

    Bof

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard