cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThePowerAppsGuy
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
seanbrogan
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
seanbrogan
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
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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,399)