cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Restart Timer with a Bottom

Hello guys,

 

I am having a hard time traing to use Timer Control in PowerApps, here what I need to do:

I have an app that should display a message every time user clique on an info icon, but should display it for a short period of time. The problem is: I have about 5 info icons, so every time a person click on the icon the time should start and count, but when the person switch to another icon the timer should restart and start to count from the beginning.

 

I dont know if I was clear, but if someone have an ideia of how to code it, please, feel free to say.

 

Ps: Until now I tried to use AutoStart and Reset properties, however, when a Timer is reseted it doesn't start again, it just stop.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MikeLockwood
Level 8

Re: Restart Timer with a Bottom

Ayla,

 

My suggestion is that you stop the timer, reset the timer, and then have the timer start again.  

- The timers Start property is set to a context variable.

- A Labels text value is set to a context variable

- The Icons onSelect property looks something like: UpdateContext({varTimer: false}); Reset(Timer1); UpdateContext({varTimer: true, varMessage: "Message1"})

 

I created a simple sample that I have attached.  Hope this is what you are looking for or maybe I misunderstood your question.

Thanks,
Mike L.

View solution in original post

5 REPLIES 5
MikeLockwood
Level 8

Re: Restart Timer with a Bottom

@Anonymous 

 

You should be able to use a context variable as the value for the timer start, that way you can set it to ture and false based on a button click.  On you icon on Select event you should be able to stop the timer via the variable, use Reset(TimerName) and then start the time again.

Thanks,
Mike L.
Anonymous
Not applicable

Re: Restart Timer with a Bottom

Hi,

 

The problem is that the timer doesn't start again, I tried use Repeat as true, but still, when I Reset the timer, it doesn't start again from the beginning.

MikeLockwood
Level 8

Re: Restart Timer with a Bottom

Ayla,

 

My suggestion is that you stop the timer, reset the timer, and then have the timer start again.  

- The timers Start property is set to a context variable.

- A Labels text value is set to a context variable

- The Icons onSelect property looks something like: UpdateContext({varTimer: false}); Reset(Timer1); UpdateContext({varTimer: true, varMessage: "Message1"})

 

I created a simple sample that I have attached.  Hope this is what you are looking for or maybe I misunderstood your question.

Thanks,
Mike L.

View solution in original post

Anonymous
Not applicable

Re: Restart Timer with a Bottom

Thats perfect! Exactly what I needed.

 

Thanks a lot! 

 

 

RyanXExner
Level: Powered On

Re: Restart Timer with a Bottom

@MikeLockwood, that solved my issue too.  Thank you so much!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,299)