cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver II
Resolver II

How to catch that the timer's running?

Hey guys,

I've got a problem and tried to solve the issue but I don't get it anyway. I don't know how to succeed.

 

I just want to disable the button if the timer is running. I press the button, the timer starts and now the button should be disabled during the timer is running. If the timer has finished, then the timer gets back to Edit mode.

 

But how to achieve this?

 

Here you can see more about the procedure with the timer and what I've implemented:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Possibility-of-effect-if-new-record-is-added...

 

I've tried to write following in DisplayMode of the button:

If(timer.Start; DisplayMode.Disabled)

or

If(timer.Value < timer.Duration; DisplayMode.Disabled)

Here the button is disabled at the beginning but it shouldn't.

 

Really appreciate your help!

ThePowerAppsGuy

1 ACCEPTED SOLUTION

Accepted Solutions
Advocate V
Advocate V

Try the following

 

Timer OnTimerStart Event

UpdateContext({varRunning:True})

Timer OnTimerEnd Even

UpdateContext({varRunning:False})

Button Display Mode

If(varRunning = True,Disabled,Edit)

View solution in original post

4 REPLIES 4
Advocate V
Advocate V

Try the following

 

Timer OnTimerStart Event

UpdateContext({varRunning:True})

Timer OnTimerEnd Even

UpdateContext({varRunning:False})

Button Display Mode

If(varRunning = True,Disabled,Edit)

View solution in original post

Unfortunately it's not working the way I want. Nothing happens.

Any suggestions?

 

Thanks so much!

Try rewriting the come in your language, i.e. semicilons instead of commas.

 

When you say nothing happens, is the timer's even running?

 

Test it using some textboxes. I.e. Put a textboxes with the default set to varRunning. This will tell you if the variable is changing or not. Set the fill of another textbox to  If(varRunning = true then green else red)

 

There is always something happening

 

Thanks for your reply.


@seanbrogan wrote:

Try rewriting the come in your language, i.e. semicilons instead of commas.


Has already been done 😉.

 


@seanbrogan wrote:

When you say nothing happens, is the timer's even running?


Yes, it's definitely running.

 


@seanbrogan wrote:

Test it using some textboxes. I.e. Put a textboxes with the default set to varRunning. This will tell you if the variable is changing or not. Set the fill of another textbox to  If(varRunning = true then green else red)


Yes, I've tried to rebuild it again in an extra Canvas app. I simulate it not with textboxes and green and red but with button enabled and disabled and it's working. I need to see what's the problem in the whole program.

 

Let's  see...

 

Thanks so much for helping!

 

-- Update --

 

Related to https://powerusers.microsoft.com/t5/Building-Power-Apps/Possibility-of-effect-if-new-record-is-added...

it's not working. But in an extra app, it is.

 

Hmmm... how to solve this issue? I'm really frustrated...

Thanks so much anyway...

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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