cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

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
Highlighted
Dual Super User III
Dual Super User III

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 II
Dual Super User II

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.
Highlighted
Helper IV
Helper IV

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 

Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Helper IV
Helper IV

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

Highlighted
Helper IV
Helper IV

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,960)