Showing results for 
Search instead for 
Did you mean: 
Helper V
Helper V

Pre populate date pickers

I have created training form from sp.

Which contains 10topics,each topic has drop-down status columnn(not started,inprogress,completed) with date picker .

Whenever user select any topic it as should update date picker automatically today.

Note: only selected topic drop-down one date should change.

Other training topic should show default.

If they change the status of other training topic then it should get change or else keep it default.

I tried updatecontext on change property of drop-down but changing dates on all training topics with out touching other topics drop-down.


Super User
Super User

Hi @Ungarala1  - I'm trying to understand the data structure/process. Is the following interpretation correct?:


  • You have 1 column for every topic (i.e. column name = topic) and in each topic column is a choice status field?
  • You have one corresponding date field for each topic
  • This is a total of 20 columns for the above
  • If a user changes the status in any topic, you want the corresponding date column to show todays date and both status update and date will be saved to the list.
  • Your default status is 'Not Started' and the default date text is shown until someone chooses another status
  • This will result in there being one row in your SharePoint list per user

yes u are correct , total 20 columns..

Super User
Super User

Hi @Ungarala1 


Please try these steps and duplicate accordingly for each topic:


  • Status drop down for each topic - add relevant number in place of #
    • In the Onselect property of each combo box control add UpdateContext({varlTopic#:Self.Selected.Value}) - This adds your selected status for that topic to a local (context) variable varlTopic#, which is used to auto populate the date....
  • Date Picker Control for each topic:
    • Change the DefaultDate property to: If( varlTopic# = "inprogress" || varlTopic# = "completed", Now(), Parent.Default)
    • Optional Change for InputTextPlaceholder property:- Change If(IsBlank(Self.SelectedDate), Text("DD/MM/YYYY"))
    • Change the 'displaymode' property of your DatePicker Datacard to 'View' - prevents users from manually changing it, but still allows the automated change from the variable
  • Lastly, be sure to set all your local variables to blank once submitted, by using the following in the 'OnSucess' property of your form: UpdateContext({varlTopic#: Blank()})


Hope this makes sense, but just shout if you have any queries


Good luck!

I need to enter last code on onsucess?

Because user will use same record for edit also?


Hi @Ungarala1 - yes insert that last code in the OnSuccess.


Note the following code in the defaultdate property will handle the scenario when someone goes back to edit. If the status has been changed for a topic and this was submitted to your backend data source, when the respective variable for that topic has been cleared, this will then present the defaultdate as the else from the following if statement, which the Datacard (the Parent) should be taking straight from the newly updated backend datasource:


If( varlTopic# = "inprogress" || varlTopic# = "completed", Now(), Parent.Default)


Hope this makes sense, but let me know if you need anything else.


Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,991)