Sep 28, 2023 06:06 PM - edited Sep 28, 2023 06:07 PM
Sharing a very basic timer I built in Interface Designer, since you cannot currently use base extensions from interfaces. Pretty easy to set-up and requires no automations - hope others find this helpful! (see attached video)
Description
This is a simple stopwatch timer that will not show a running time, but by clicking buttons you can check your time. It offers basic stopwatch functionality - you can start, stop, check, and reset the timer, but you cannot pause the timer and pick it back up.
In my base design, time entries are a child record of task records. In the interface, this allows users to select a task and log time to it.
Set-Up
In my base, I have my time entries table with 3 checkbox fields. Each of these fields also has a Last Modified Time field that inspects it. I've named these:
In my interface, when you open a time entry you can run the stopwatch timer by clicking on the buttons. I've configured the buttons so that:
Back in the base, I have 3 formula fields:
Check Timer - DATETIME_DIFF
IF(
AND(
{Start Timer},
{Check Timer - Last Modified Time}
),
DATETIME_DIFF(
{Check Timer - Last Modified Time},
{Start Timer - Last Modified Time}
),
0
)
As you can see, this field will simply return the DATETIME_DIFF between when the Start Timer and Check Timer checkbox fields were last manipulated
Stop Timer - DATETIME_DIFF
IF(
AND(
{Start Timer},
NOT(
{Stop Timer}
)
),
0,
IF(
AND(
{Start Timer},
{Stop Timer}
),
DATETIME_DIFF(
{Stop Timer - Last Modified Time},
{Start Timer - Last Modified Time}
),
0
)
)
Likewise, this field will give the DATETIME_DIFF between when the stopwatch timer was started and stopped (under the condition that both checkbox fields are marked which, because users are only manipulating this using the interface buttons, should be the case)
Check Timer (Interface Element)
IF(
{DATETIME_DIFF - Stop Timer (h:mm:ss)} != 0,
{DATETIME_DIFF - Stop Timer (h:mm:ss)},
IF(
NOT(
{Start Timer}
),
0,
IF(
AND(
{DATETIME_DIFF - Stop Timer (h:mm:ss)} = 0,
{DATETIME_DIFF - Check Timer (h:mm:ss)}
),
{DATETIME_DIFF - Check Timer (h:mm:ss)}
)
)
)
This field I display in the interface (and set to extra large!) so users can see their time. It is configured to show:
Conclusion
In my base, this is one of 3 methods by which users can enter time. They can also manually enter time using a simple duration field, or they can enter a start time and an end time and the base will just calculate the difference. The "true" time of the time entry is given by this formula field:
IF(
{Manual Duration (h:mm)},
{Manual Duration (h:mm)},
IF(
AND(
NOT(
{Manual Duration (h:mm)}
),
{Duration from Start and End Time Subtraction (h:mm:ss)}
),
{Duration from Start and End Time Subtraction (h:mm:ss)},
IF(
AND(
NOT(
{Manual Duration (h:mm)}
),
NOT(
{Duration from Start and End Time Subtraction (h:mm:ss)}
),
{DATETIME_DIFF - Stop Timer (h:mm:ss)}
),
{DATETIME_DIFF - Stop Timer (h:mm:ss)},
IF(
AND(
NOT(
{Manual Duration (h:mm)}
),
NOT(
{Duration from Start and End Time Subtraction (h:mm:ss)}
),
NOT(
{DATETIME_DIFF - Stop Timer (h:mm:ss)}
)
),
0
)
)
)
)
Hope people find this helpful, and I'm always open to feedback on ways to streamline this system!