cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Soko19
Level: Powered On

Timer: "OntimerEnd" function not working

Hello,

 

I am looking to record how long it takes my employee to complete a task.

 

I want them to activate the timer by hitting Start and then i want them to Stop the timer by hitting Stop.

 

After they Start /STop the timer i want to record how long thast task took them in a Text field that is connected to sharepoint. 

 

Example of Power apps Page:

 

Date: 08/24/2018

Task: XYZ

Start Button:

StopButton:

 

Total: Time: = Timer reesults after the stop button is selected. 

 

Then they hit the submit button and it submits the editform and resets everything to default.

 

Please help. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Timer: "OntimerEnd" function not working

Hi @Soko19,

 

The OnTimeEnd property will only be triggered when the timer control run out of the duration time range configured.

 

If you would like to record the time when the stop button pressed, then please follow the steps below:

1. Add a Timer control, two buttons, one for Start, another for Stop,

2. Configure the OnSelect property of the Start Button to:

UpdateContext({TimerStart:true})

3. Configure the OnSelect property of the Stop Button to:

UpdateContext({TimerStart:false});UpdateContext({TimerStop:Text(Time(0, 0, Timer1.Value/1000), "[$-en-US]hh:mm:ss")})

4. Configure the Start property of the Timer control to:

TimerStart

5. Add a Label control, configure its Text property to:

TimerStop

6. Under the Submit button, add the following code:

UpdateContext({TimerReset:True})

7. Under the Screen OnVisible property:

UpdateContext({TimerReset:false})

8. Under the Reset property of the timer control, enter the following:

TimerReset

More reference:

Timer control in PowerApps

Variable in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Timer: "OntimerEnd" function not working

Hi @Soko19,

 

The OnTimeEnd property will only be triggered when the timer control run out of the duration time range configured.

 

If you would like to record the time when the stop button pressed, then please follow the steps below:

1. Add a Timer control, two buttons, one for Start, another for Stop,

2. Configure the OnSelect property of the Start Button to:

UpdateContext({TimerStart:true})

3. Configure the OnSelect property of the Stop Button to:

UpdateContext({TimerStart:false});UpdateContext({TimerStop:Text(Time(0, 0, Timer1.Value/1000), "[$-en-US]hh:mm:ss")})

4. Configure the Start property of the Timer control to:

TimerStart

5. Add a Label control, configure its Text property to:

TimerStop

6. Under the Submit button, add the following code:

UpdateContext({TimerReset:True})

7. Under the Screen OnVisible property:

UpdateContext({TimerReset:false})

8. Under the Reset property of the timer control, enter the following:

TimerReset

More reference:

Timer control in PowerApps

Variable in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Soko19
Level: Powered On

Re: Timer: "OntimerEnd" function not working

Thank you. This worked

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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