cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Christian-Chapp
New Member

Time gating my App

I have certain users on my app with Various levels of permissions.

 

I am exploring an option to prevent usage of my App on weekends and After 5pm on weekdays for users.

 

My app has a home page with a button to Navigate to the data in the app.

Im looking to disable this during specified times. Is this possible, if so how could i do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Eelman
Super User
Super User

@Christian-Chapp you could use the Weekday and Hour functions to do this.

 

On the DisplayMode of the button that navigates to / shows your data try this:

 

Button1.DisplayMode = if( Weekday( Now()) = 1 || Weekday ( Now()) =7 || Hour( Now()) > 17, DisplayMode.Disabled, DisplayMode.Edit)

 

Note: Weekdays 1 & 7 are the defaults for Sunday and Saturday and the Hour 17 is 5pm (ie 12 + 5) check this link for further info https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datetime-parts

 

This should work?

View solution in original post

2 REPLIES 2
Eelman
Super User
Super User

@Christian-Chapp you could use the Weekday and Hour functions to do this.

 

On the DisplayMode of the button that navigates to / shows your data try this:

 

Button1.DisplayMode = if( Weekday( Now()) = 1 || Weekday ( Now()) =7 || Hour( Now()) > 17, DisplayMode.Disabled, DisplayMode.Edit)

 

Note: Weekdays 1 & 7 are the defaults for Sunday and Saturday and the Hour 17 is 5pm (ie 12 + 5) check this link for further info https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datetime-parts

 

This should work?

View solution in original post

This Worked Perfectly. Thank you very much.

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,117)