Hi,
i have this in my onchange property of a date picker
If (
DataCardValue39_1.SelectedDate > Today(),
UpdateContext({ResetDatePicker: true}),
UpdateContext({ResetDatePicker: false})
)
which works nicely! however if I try it a second time affter the initial reset, it doesnt reset the date picker.
Anyone know why?
I am unable to recreate the issue on my end. A possible explanation as to why the DatePicker will not reset is that the variable is still set to true during the second attempt. Should the variable be shared amongst other controls (that may not set it back to false) - this could explain the issue.
Should you prefer to use a variable instead of the Reset approach above, I would recommend placing both the true and false update within the true section of your If statement:
If(
DataCardValue39_1.SelectedDate > Today(),
UpdateContext({ResetDatePicker: true}); UpdateContext({ResetDatePicker: false})
)
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
Hi @wonka1234,
Should the reset be limited to the current DatePicker control you could use the following code (variable is not needed):
If(
Self.SelectedDate > Today(),
Reset(Self)
)
I hope this helps!
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional