Need to embed timer capability into app

behavior
ux
(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.

Possible?

(Levent Kulacoglu) #2

@Mahesh,
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

ISBLANK([START])

Set below condition for End Timer

AND(ISNOTBLANK([START]),ISBLANK([END]))

After that set below AppFormula for the duration column:

[END] - [START]

4 Likes
(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.

Ideas?

(Levent Kulacoglu) #4

@MaheshG
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

@Eric_Schwartz
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 > https://www.appsheet.com/portfolio/245151

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

@Eric_Schwartz
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

@Eric_Schwartz
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

@Mahesh
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.