cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Geotrix
Post Partisan
Post Partisan

Make something visible if it‘s 10 o‘clock

I wanna make my label and Icon visible, if it‘s 10 o‘clock. How can I do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

As I mentioned above, the only way to do that is to have a timer control that re-evaluates the current time on some interval.  When the time falls within a time period then run the formula to set the variable or populate the collection.  The trick is that if the interval for the timer is too short your performance will degrade, because it keeps doing something to the timer.  But if the interval is too long then the timer may not catch the timeslot you want.

 

So as a test.  Add a timer to the app, set Autostart too true and Set repeat to true. Set the duration to an appropriate Interval.  The default is 60,000 which is 60 seconds.  300,000 would be a good starting number (5 minutes). In the timer set OnTimerEnd to your formula.

If(Hour(Now()) = 10 && Minute(Now()) <= 5,Set(displaycontrol, true),Set(displaycontrol, false))

Then set the visible property of the control to displaycontrol.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Adrian_Celis
Solution Supplier
Solution Supplier

Hi @Geotrix 

 

Do you want to show the label and icon from 10:00am to 10:59am?

You can use this formula in the Visible property of your label and icon:

Hour(Now()) = 10

 

Pstork1
Dual Super User III
Dual Super User III

If the app is refreshed in that time period the label will show.  But that formula won't be re-evaluated unless something resets the control.  If you enter the page at 9:59 the label will continue to be hidden until you leave and re-enter the page or reset the control.  You would need a timer that is continually checking the time to get it to change visibility spontaneously.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Adrian_Celis Hi, that‘s great, and if I I want to make a collection at 10:00, how can I do this?

Hi @Geotrix 

Did you mean you want it to happen at 10:00 and then end at 10:01?

Add a Minute function to the formula

 

Hour(Now()) = 10 And Minute(Now()) = 0

@Adrian_Celis That was my first question, but how can I start an action if it‘s 10 o‘clock?

Pstork1
Dual Super User III
Dual Super User III

As I mentioned above, the only way to do that is to have a timer control that re-evaluates the current time on some interval.  When the time falls within a time period then run the formula to set the variable or populate the collection.  The trick is that if the interval for the timer is too short your performance will degrade, because it keeps doing something to the timer.  But if the interval is too long then the timer may not catch the timeslot you want.

 

So as a test.  Add a timer to the app, set Autostart too true and Set repeat to true. Set the duration to an appropriate Interval.  The default is 60,000 which is 60 seconds.  300,000 would be a good starting number (5 minutes). In the timer set OnTimerEnd to your formula.

If(Hour(Now()) = 10 && Minute(Now()) <= 5,Set(displaycontrol, true),Set(displaycontrol, false))

Then set the visible property of the control to displaycontrol.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

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