cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Advocate III
Advocate III

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
Highlighted
Advocate III
Advocate III

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

Highlighted
Advocate III
Advocate III

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

Highlighted
Anonymous
Not applicable

Re: Restart Timer with a Bottom

Thats perfect! Exactly what I needed.

 

Thanks a lot! 

 

 

Highlighted
Advocate II
Advocate II

Re: Restart Timer with a Bottom

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

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

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,517)