Simple timer with pause/continue capability (single table design)

A super simple task time tracker / stopwatch that supports pausing the timer. Done in a single table; leverages Coda’s capability to store lists of values in a cell.

Can be handy if you want to track net time spent on your tasks. You can further aggregate on these lists of clock-in/clock-out times, e.g. calculate the total time per task from start to finish:

[Clock outs].Max() - [Clock ins].Min()

or calculate individual intervals:

Sequence(1, thisRow.[Clock outs].Count()).FormulaMap(
  thisRow.[Clock outs].Nth(CurrentValue) - thisRow.[Clock ins].Nth(CurrentValue)
)

or calculate the sum of break times, but filter out breaks that are 3+ hours long, you name it

11 Likes

And the machine strikes again! Good work man.

2 Likes

Very simple and useful in most of cases :+1:

Any idea why the formula stops at 3h of work?

Looks like they can run with just one entry, but they break in the next one. That intrigues me, and unfortunately limits the usage like:
Long tasks for video editing, that I work whit, are normal.
And you can’t use for calculate work shift in the most cases.

Stops at 3h?.. This seems strange. Maybe it’s just a formatting issue. I don’t see why it could possibly stop working.

Will let it run today and debug.

UPD @Christian_Conte Not sure what you saw. I edited the first clock-in, and it’s working:

What could be happening is that if you manually edit the value once there’s a few timestamps in the cell, it stops being a list and becomes just a string with commas. So yeah, don’t edit timestamps when there are some in the cell already:

1 Like

Also CC @Raul_San_N.H — I remember you were interested in adding time tracking in one of your docs. Here’s a simple way to add that to the existing table.

1 Like

Very clever and handy too. When will you publish the Unofficial Guide to All Things Coda?

Hi @Paul_Danyliuk
Is there any advantage in using this approach over logging time in separate table, as in Want to track your time across tasks??

Just the advantage of not having to use a separate table :slight_smile: Could be cost advantage for some (intervals not counting towards the rows quota in free plan).

The disadvantage is explained in a gif above: you cannot edit the timestamps without losing the “list” status of the cell.

This template serves more of a “FYI this is possible too” purpose, like most of my templates do.

1 Like

Great solution @Paul_Danyliuk. Thank you for the ping here!

@Paul_Danyliuk Tanks, i just tried do that for test the thing and end breaking it in a way that not will happen naturally UAHUAH

@Asaf_Dafna, In my case, things that is interesting to have more control on each entrancei like of take this “each row is a entrance” approach.
Like in this table:

But for making a work shift doc, were i wish to use a use each to store one shift , this give the flexibility that I need for making multiple breaks in the same shift without need to restrict how many breaks they will have :grin:

In the other centenary I was forced to use the extra shift if some employ really need one more break than I predict, what just f* the things. You can do more than one extra shift by day, but they also COST MORE.

Plus, if you set a big break limit, like “5 breaks per shift”, you making a incentive to they pick up all the breaks each day, ween i want to stimulate focus and give they freedom to make they breaks ween they need.

Now this is solved :partying_face:

So is not really about of advantages, but more about flexibility an more design choices.
Is one more tool in or coda-belt :bat:
You need to see what of they works best on your project.

1 Like

I really liked this post and had someone ask me if they could just click to start the next task and have the first one automatically stop. I used this post for the basis of it and added a “Push Button” with a formula to make it work…

@Paul_Danyliuk, thanks a ton for this post! Its a creative and efficient solution!

5 Likes

Hey guys,

I am looking for a solution that would let me add the time spent on an activity into the comments section, something I see in a lot of other productivity apps. This solution looks great, but is there a way to “force” Coda to also include some commentary alongside the logged time? Something like “worked with John for 1/2 hour on how many hours we will credit the client”?

I posted a request for some additional native Time Tracking solutions as well here, where I talk about this in some more detail:

These solutions are all great, but even this much use of forumlas causes me confusion, and takes a lot of time to implement! Sorry maybe I’m just the most novice participant in this community…

This is not an unreasonable feeling or idea. Formulas can get nutty and typically because they are used to overcome other shortfalls such as - there’s no accessibility to the content plane of conversations. Often, conversations about data is more valuable than the data itself.

The spirit of Coda is all about reimagining documents that are made of information. And by “information” we all agree that sections, data, and conversations about these information artifacts are central to doing good work.

Observation - vastly, 2/3rds of the content is inaccessible through the API or through formulaic integration. This must change as soon as possible.

1 Like

Great comment as always @Bill_French. Very eager to see when Team Coda starts to get to a lot of what you’ve been discussing in the community. So far this year I can’t really put my finger on any specific new functionality that addresses one of your concerns, can you? Nor am I getting any sense from the info that the Product group teases of any of this stuff being set for imminent release. I was in fact testing a new table configuration prototype but turned it off as it actually complicated my flow more than the current one.

Cheers & hope you maybe getting some skiing in (your Avatar always allures me), or spending time in that fine cabin, a pic of which you shared with us!

1 Like

Cul-de-sacs are everywhere on the bleeding edge of innovation. :wink:

2 Likes

What is the logic behind this formula. How does it Calculate the total time based of the aggregated timestamps? Would I be able to replicate it in Google sheets?

No because in Google Sheets you can only have one simple value (e.g. one timestamp) in a cell. Or maybe you can have a list of timestamps in a single cell somehow but the logic to calculate those won’t be as easy as in Coda.

Specifically that formula — get the earliest clockin and latest clockout and calculate the full duration of the task including any pauses.

If you want to only calculate the sum when you were working on the task minus the pauses, use

[Clock outs].Sum() - [Clock ins].Sum()

The logic here is that individually each Clock-out minus Clock-in would give you a duration of that one interval. If you take the sum of those durations, you get the total time spent on tasks. But that’s the same as taking the sum of all Clock-outs and subtract the sum of all Clock-ins:

(B1 - A1) + (B2 - A2) + ... + (Bn - An)

equals

(B1 + B2 + ... + Bn) - (A1 + A2 + ... + An)

Overall this timer works in Coda because one cell can have a list of values, or basically any data structure stored in it.

Wish there was a bit more robust way to store a list in a cell. It gets particularly tricky if you have nested lists
E.g.

[["a", 1],["b", 2],["c", 3]]

Deleting entries is quite difficult as well as looking up values based on their keys.

A hash table type data structure would be quite nice for the cases where you want lookup abilities without the overhead of a full table.

Any tricks for doing that, @Paul_Danyliuk?

I’m myself not a big fan of this approach and would rather make separate tables than storing lists in cells like this. As you said, it’s not easily editable (unless it’s a multi-Select or a multi-Lookup).

Yeah, I get that. I just have a lot of data I don’t need users to interact with which I don’t want to put into yet another lookup table.