web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding Timer value to ...
Power Apps
Unanswered

Adding Timer value to an existing field

(0) ShareShare
ReportReport
Posted on by 2
I am building an app for our technicians to record details and time spent repairing equipment.
This is my first attempt using Power Apps but with hours of googling and YouTube, I think I have got most of it sorted out.
 
There is one function that I am not too sure of the best way to handle.
In order to record the time spent repairing the item, they would like a simple stopwatch function.
The difficult part (for me) is that they will not always repair the item in one go (they are likely to spend time diagnosing the problem, then order parts in before spending more time completing the repair)
 
I have suggested a simple timer, a separate 'Repair Time' field and a button that adds the timer/stopwatch result to the repair time.
 
 
I have added a timer and a start and stop button to the app.
 
Start button OnSelect = UpdateContext({TimerGo: true})
Stop button OnSelect = UpdateContext({TimerGo: false})
Timer Start = TimerGo
 
 
The app is based on a SharePoint List and there is a number column called Repair Time. This is a datacard field on the editscreen where the timer is located.
 
Is it possible to add a button (called 'Add Time') that will add the timer value to the Repair Time field (this may already contain a number so it must add and not replace).
  • We only wish to record the repair time in minutes, we are not interested in hours/seconds.
  • The value should also be able to be overwritten manually (for example; they start the timer and half way through repairing the item, wander off to get a coffee and come back to find the timer still running. When they stop the timer, they may wish to just add 20 minutes instead of 30 minutes to the Repair Time).
 
Or is there a better way that you can think of?
I have come across the DateDiff function but I'm not sure if that is relevant here?
 
Thank you
Categories:
I have the same question (0)
  • Suggested answer
    jrletner Profile Picture
    720 Super User 2025 Season 2 on at
    Adding Timer value to an existing field
    Maybe try something like this to handle your issue:
     
    // Calculate minutes from the timer
    Set(CurrentTimerValue, RoundUp(TimerControl.Value / 60000, 0));
     
    // Add timer minutes to existing Repair Time value
    DataCardValue_RepairTime.Text = Value(DataCardValue_RepairTime.Text) + CurrentTimerValue;
     
    // Reset Timer and context variable
    Reset(TimerControl);

    UpdateContext({ TimerGo: false });
    Notify("Time added successfully", NotificationType.Success);
     
     
    For the time adjustment, something like this might help:
    • Add a Number Input control (a text input configured to only accept numbers) labeled "Adjust Time (minutes)" This field will allow the technician to enter the number of minutes to add or subtract from the repair time.
    • Name this control txt_AdjustTime
     
    // Calculate the timer value in minutes
    Set(CurrentTimerValue, RoundUp(TimerControl.Value / 60000, 0));
     
    // Get manual adjustment value (can be positive or negative)
    Set(ManualAdjustment, Value(txt_AdjustTime.Text));
     
    // Calculate the new Repair Time
    DataCardValue_RepairTime.Text = 
        Max(0, Value(DataCardValue_RepairTime.Text) + CurrentTimerValue + ManualAdjustment);
     
    // Reset Timer, Adjustment Input, and Context Variables
    Reset(TimerControl);
    UpdateContext({ TimerGo: false });
    Reset(txt_AdjustTime);
     
    // Notify the user of successful adjustment
    Notify("Time added and adjusted successfully", NotificationType.Success);

     
  • 987321 Profile Picture
    2 on at
    Adding Timer value to an existing field
    Thank you Jrletner,
     
    It looks like it may be a little harder than I hoped for (given my limited experience)
     
    I may go back to the business and see if they are happy enough just adding the time from the timer manually as required.
     
    Once I've got the rest of the app built and published, I might revisit this requirement in Dev when I have more time.
     
    I will mark it as answered.
     
    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard