cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TCH
Level: Powered On

Disable based on time

Hi there, 

I have a question for you, 

I have a button that patches information to a SP list, i would like for this button to be disabled based on time and maybe date 🙂 

I have tried to wickle my way around this, and have come up with this function/statement: If(Now()>Time(14;30;00);Disabled;Edit) the idea being that if the time has passed half 2 the button would be disabled, now PA doesn't complain about this statement but it also doesn't actually follow it, it just shows the button in edit mode no matter the timestamp? 

Has anyone got an idea of how to work around this issue, or maybe a completely different solution. 

Thanks in advance 
Best Wishes
Tobi 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Disable based on time

Hey @TCH 

 

Can you try to update your expression as:
 
If(TimeValue(Text(Now())) > Time(14,30,00),Disabled,Edit)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: Disable based on time

The problem is that you are expecting it to dynamically re-evaluate Now() in real time.  It won't do that.  It will evaluate your formula when the screen loads or at some other time depending on where you put it.  To get the kind of real time support you want I would suggest changing the formula to save a value in a variable.  Then use that formula in a Timer that runs on a cycle.  The variable value would be set on the completion of each cycle. Then enable or disable the button based on the value in the variable.

 

The problem with that design is that if you make the timer cycle too short it could really drain performance.



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

Re: Disable based on time

@Pstork1 

Would you happen to have any suggestions on how to achieve this, I have tried to do the best i can, but it does not seem to be working? 🙂 

- Tobi 

Dual Super User
Dual Super User

Re: Disable based on time

Hey @TCH 

 

Can you try to update your expression as:
 
If(TimeValue(Text(Now())) > Time(14,30,00),Disabled,Edit)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

TCH
Level: Powered On

Re: Disable based on time

Yes of course! I feel like an idiot i have litteraly used this but because most forums and sites are from the US the syntax(seperators) are different, and it only occured to me now that that was the issue 🙂 

Thanks

TCH
Level: Powered On

Re: Disable based on time

@yashag2255  

Hi again, 

DisplayMode: If(TimeValue(Text(Now())) > Time(14,30,00),Disabled,Edit) definately works when it comes to the time a day, however, i am now looking to expand on this, i essentilly want the displaymode to be disabled if the time is within 14,30,00 on a specific day, 

I have checkboxes Monday through Friday, Monday should close of af 1430 on mondays, however Tuesday, Wednesday, Thursday, Friday should still be available to check off?? 

I thought you might have some input on how this might be achieved? 🙂 

- Tobias

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,781)