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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (25,737)