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 / Pre populate date pickers
Power Apps
Unanswered

Pre populate date pickers

(0) ShareShare
ReportReport
Posted on by 184

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.

 

Categories:
I have the same question (0)
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    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
  • Ungarala1 Profile Picture
    184 on at

    yes u are correct , total 20 columns..

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    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!

  • Ungarala1 Profile Picture
    184 on at

    I need to enter last code on onsucess?

    Because user will use same record for edit also?

     

  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    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.

     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 893

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 482

Last 30 days Overall leaderboard