cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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

Highlighted
Helper I
Helper I

Re: Timer: "OntimerEnd" function not working

Thank you. This worked

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 (7,701)