Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Q4h7NyoZnVbmSLDkQdnZvY
Power Apps - Building Power Apps
Unanswered

Pre populate date pickers

Like (0) ShareShare
ReportReport
Posted on 18 Nov 2021 22:19:24 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.

 

  • Gerard Simpson Profile Picture
    2,987 Super User 2025 Season 1 on 22 Nov 2021 at 10:13:28
    Re: Pre populate date pickers

    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.

     

  • Ungarala1 Profile Picture
    184 on 22 Nov 2021 at 08:49:21
    Re: Pre populate date pickers

    I need to enter last code on onsucess?

    Because user will use same record for edit also?

     

  • Gerard Simpson Profile Picture
    2,987 Super User 2025 Season 1 on 20 Nov 2021 at 01:47:08
    Re: Pre populate date pickers

    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 19 Nov 2021 at 03:08:06
    Re: Pre populate date pickers

    yes u are correct , total 20 columns..

  • Gerard Simpson Profile Picture
    2,987 Super User 2025 Season 1 on 18 Nov 2021 at 23:50:38
    Re: Pre populate date pickers

    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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 14

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard