I have a datepicker in a powerapp. I have a rectangle cover that sets it's Visibility to true (context variable) when the datepicker control is selected to cover up the buttons still exposed behind the calendar. What I don't see is any action for powerapps to be aware of when the Calendar is showing/not showing. For normal action, it doesn't matter as selecting a (different) date triggers the OnChange property and sets the Visibility (context variable) to false. However, if the user selects the same date as was previously set and then OK or hits Cancel, the OnChange event does not fire and the visibility doesn't get set to false. As a workaround, I have set the OnSelect property for the rectangle to set the visibility to false (context variable) so the user is not stuck. To do this right though, I wanted to know if there is any way to trigger anything based upon either the calendar being visible/not visible or trigger when a user is selecting the OK or Cancel button in the calendar.
Thanks,
Brian
Solved! Go to Solution.
Hi @BrianCCampbell ,
There is no such out of box property to show the visible status of Calendar Tab, and the Cancel button doesn't trigger anything, so it's a little tricky.
As an alternative workaround, I accomplish your needs by a TextInput box, Calendar icon, and a calendar component.
Please find the calendar component in the attachment.
1. import the calendar component into the app
2. add a TextInput box, Calendar icon, and a calendar component
3. set App.OnStart: Set(MyVar,false)
3. set Text box.Default: Calendar_1.StartDate
4. set icon. OnSelect: Set(MyVar,true);Set(selectedDate,Calendar_1.StartDate)
5. set OK Button.OnSelect: Set(MyVar,false)
6. set Cancel Button.OnSelect: Reset(Calendar_1);Set(MyVar,false)
7. set rectangle.Visible: MyVar
Test Result:
Hope this helps.
Sik
Hi @BrianCCampbell ,
There is no such out of box property to show the visible status of Calendar Tab, and the Cancel button doesn't trigger anything, so it's a little tricky.
As an alternative workaround, I accomplish your needs by a TextInput box, Calendar icon, and a calendar component.
Please find the calendar component in the attachment.
1. import the calendar component into the app
2. add a TextInput box, Calendar icon, and a calendar component
3. set App.OnStart: Set(MyVar,false)
3. set Text box.Default: Calendar_1.StartDate
4. set icon. OnSelect: Set(MyVar,true);Set(selectedDate,Calendar_1.StartDate)
5. set OK Button.OnSelect: Set(MyVar,false)
6. set Cancel Button.OnSelect: Reset(Calendar_1);Set(MyVar,false)
7. set rectangle.Visible: MyVar
Test Result:
Hope this helps.
Sik
Thanks so much for the alternative workaround and the definitive answer that at this time the calendar visibility and cancel are not actionable in PowerApps.
Thanks,
Brian
Hi @BrianCCampbell , @v-siky-msft
Check out custom date picker control for Power Apps.
Please check this link for installation instructions.
http://themicroconsulting.com/powerapps-custom-calendar-component-with-time-picker/
Your feedback will be more than appreciated.
Thanks 🙂
User | Count |
---|---|
165 | |
90 | |
72 | |
64 | |
62 |
User | Count |
---|---|
210 | |
152 | |
96 | |
86 | |
66 |