cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianCCampbell
Resolver I
Resolver I

Action on datepicker - when the calendar shows

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.
Screen Shot 2020-04-25 at 8.46.14 PM.png

 Thanks,

 

Brian

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

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: GIF_67.gif

Hope this helps.

Sik

 

 

 

View solution in original post

3 REPLIES 3
v-siky-msft
Community Support
Community Support

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: GIF_67.gif

Hope this helps.

Sik

 

 

 

View solution in original post

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

microconsulting
Frequent Visitor

Hi @BrianCCampbell , @v-siky-msft 

ezgif.com-gif-maker (1).gif

 

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 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,949)