Hello
I am creating an app that based on the dropdown value it will populate todays date on a date time picker, but if the value on the dropdown is not equal to "On Hold" it should either display the Parent Default or blank. The problem using Today() to set the datetime picker is that on the next day the value will change and I need this date value to be static until the user changes the dropdown
Code on Dropdown:
OnSelect: If(DataCardValue15.Selected.Value = "On Hold",UpdateContext({HoldVar:Today()}),DataCardValue15.Selected.Value <>"On Hold",UpdateContext({HoldVar:Blank()}));
Code on Date time picker
DefaultDATE: If(DataCardValue15.Selected.Value = "On Hold",HoldVar2)
Solved! Go to Solution.
Hi @LRio,
Do you want to to display a static date value for Date Picker before the user changes the dropdown value from "On Hold" to other?
If so, I think you just need to save the logged date in a variable and assign it to the DefaultDate property of the Date Picker.
Set the DefaultDate property of the Date Picker as below:
If(DataCardValue15.Selected.Value = "On Hold",HoldVar)
Dropdown OnSelect:
If(DataCardValue15.Selected.Value = "On Hold",UpdateContext({HoldVar:Date(2021,12,21))}),DataCardValue15.Selected.Value <>"On Hold",UpdateContext({HoldVar:Blank()}));
i have tried the On change as well but If i do the On change, as soon as I enter edit mode it will bring in the current time. I just need a simple method to record a time stamp based on a dropdown. If "on hold" is selected then log todays date, else blank, but if i go back to the records it should display the logged date
Ok, but every time a user selects the dropdown when using OnSelect, your code will run. This is typically not ideal.
try this on your DefaultDate
If(DataCardValue15.Selected.Value = "On Hold",HoldVar2, Parent.Default)
You can also try using
ThisItem.yourCoulmnNameHere
if the above doesn’t work
Hi @LRio,
Do you want to to display a static date value for Date Picker before the user changes the dropdown value from "On Hold" to other?
If so, I think you just need to save the logged date in a variable and assign it to the DefaultDate property of the Date Picker.
Set the DefaultDate property of the Date Picker as below:
If(DataCardValue15.Selected.Value = "On Hold",HoldVar)
Dropdown OnSelect:
If(DataCardValue15.Selected.Value = "On Hold",UpdateContext({HoldVar:Date(2021,12,21))}),DataCardValue15.Selected.Value <>"On Hold",UpdateContext({HoldVar:Blank()}));
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
187 | |
53 | |
41 | |
37 | |
31 |
User | Count |
---|---|
250 | |
75 | |
71 | |
68 | |
65 |