Need to embed timer capability into app

(mahesh G) #1

App has the need to keep track of duration of some task. For that, I would like to introduce the ability to start and stop a timer (or anything similiar) that would help track the elapsed time in minutes/seconds.
User will start, stop and then the elapsed time will be captured in a column.


(Levent Kulacoglu) #2

Yes it’s possible. You need to have 3 columns in your table: 2 of Datetime type and 1 Duration type.

Construct 2 actions for your table:

Start Timer and End Timer

Both are *Data: change the value of a column actions, setting the value of NOW().

Set below condition for Start Timer


Set below condition for End Timer


After that set below AppFormula for the duration column:


(Mahesh) #3

@LeventK, worked great! Thanks!
Any functionality to change color on the Action button? Right now the start button get replaced with stop button which is great but having them of different color would make it even more clear, say green start button and red stop button.


(Levent Kulacoglu) #4

You can use UX > Format Rules to change the color and the icon of your action buttons displayed in the Detail View. Can you also please mark my post as solution provided it fits your needs and requirements? It can be helpful for other community members when they search for the solution tag. Thank you.

1 Like
(Eric Schwartz) #5

Any thoughts how this could be applied on a button on a Job Detail view, to set the Start time on a new related Timesheet table record?

(Levent Kulacoglu) #6

You need to set an action in the Timesheet table first as I have explained above and set its prominence to No display. Then you need to set an action in Jobs table with Data: execute an action on a set of rows, choose Timesheet as the Referenced table and use a SELECT expression in Referenced rows property to select any particular record(s) that you wish and select the action that you have specified in Timesheet table Referenced action.

It’s also possible to create actions that are directly shown as inline actions within the related records inline view.

You can see it in action in my community sample app below. You are free to copy the app from my portfolio >

1 Like
(Eric Schwartz) #7

Hi @LeventK
Very cool. Thanks for sharing.
My question points in a different direction.
Job has a related table Timesheets.
Viewing the Job Detail view, the user will click Action button “Add Job Timesheet”, creating a new Timesheet record, with JobID reference value populated.
I created a “Add Record” action on table Timesheet, called “Add Timesheet”.
The “Add Timesheet” action is not available to a Job table action?

1 Like
(mahesh G) #8

@LeventK, I am finding the duration column which calculated as [END] - [START] is not getting set reliably. It gets set most of the time but sometimes I see both the Start and End values in the column but the duration is blank. I am wondering if I should use a google sheet formula on the Duration column instead of computing via AppSheet

Looking for opinion on the pros and cons of doing this.

(Levent Kulacoglu) #9

Of course it’s possible. I will add that functionality to my sample app tomorrow and ping you so that you can check.

(Levent Kulacoglu) #10

I have updated my sample as you have queried for. Can you please check and inform me if is it the feature what you were asking? Thnx.
Note: If you have downloaded it, please remove your copy and pls copy it again to get the latest enhancement.

(Levent Kulacoglu) #11

Actually I’ve never experienced any inconsistency when calculating durations with AppSheet. Provided you are experiencing blank results, it’s a possible that your expression might not be correct or there’s a problem with your columns’ type settings. Please check my sample app, it calculates the duration as required.

(Eric Schwartz) #12

Thanks @LeventK for opening the door into Deep Links.
Very much appreciated :man_student:

(Levent Kulacoglu) #13

You’re welcome @Eric_Schwartz, truly my pleasure to be helped of.