Need to embed timer capability into app

Mahesh
Participant V

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?

Solved Solved
0 15 3,123
1 ACCEPTED SOLUTION

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

View solution in original post

15 REPLIES 15

LeventK
Participant V

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

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

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

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?

@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

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?

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

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

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

Youโ€™re welcome @Eric_Schwartz, truly my pleasure to be helped of.

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

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

When I try to do what you have written here, why do I get โ€œThe expression is valid but its result type โ€œYes/Noโ€ is not one of the expected types: Timeโ€?
I am specifically referring to the Isblank line. Canโ€™t get further than that.

Hello, I am new to this but i am trying to follow your instructions.  AppSheet is very different from 2019.  Could you please tell me or screen shot how this is suppose to look on the updated version.

tloder
Participant I

Hi, I am having trouble creating the start/stop buttons in my app. I think all of the columns values are set properly, I just copied your My Timesheets settings. Same for Actions. The problem is my app UX is just showing the start time as date time prefilled, and end time is just time. See image below.

Thanks for all of your help.

Top Labels in this Space