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

Soko19 Helper I
Helper I

Re: Timer: "OntimerEnd" function not working

Thank you. This worked

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,377)