Static "Saved" Time for Timesheet

Hi all,

I’m creating a timesheet for employees to manage their clock in & clock out. Right now I have 2 columns “Time In” & “Time Out” that is non editable.

Time In = [Timestamp] so that employee can use the very initial time when they start the form

Time out = NOW()
I’m facing a problem with NOW() as employee might want to edit the forms after they saved. Once they went to the edit button, the time out changed to the current time instead of the time they saved.

Is there a way to keep a static time of the saved forms?

1 Like

How did yo make them “non editable”?

Where does [Timestamp] come from? How do you implement Time In = [Timestamp]? App formula? Initial value?

How did you implement this? App formula? Initial value? Action?

2 Likes

Sorry, Because previously my app allows users to set the time themselves and I felt that the results weren’t that accurate and many employees kinda cheat on the system. That’s why I was trying to make the “Time in” & “Time out” non editable and only allows current time of the device.

The [Timestamp] is from the time when the row is created. I implemented in App Formula.

App formula.

2 Likes

Rather than using App formula for Time In, I would recommend moving the expression from App formula to Initial value, then setting the column’s Editable? setting to the expression, FALSE. This will set the column’s value when the row is created (whereas App formula resets it every time the row is changed) and prevents the user from changing the value.

1 Like

Thanks! But the main concern is actually the “Time Out”. How do I able to save a time for “Timeout” of the form?

1 Like

Pretty much the same way.

1 Like

Hey @Steve_Tan I would make use of an action to set the timeout, giving the user the ability to tap it and set the actual time to “now” but not allowing them to actually modify the value.

For the timeout, I would put a show if formula to restrict when it’s seen so we don’t see it in the form

  • Show If: CONTEXT(“ViewType”) <> “Form”

Create an action that sets the value of the Timeout column (something similar to this)

  • For the condition of this action, use the following:
    • ISNOTBLANK([Timeout])
  • I would turn on the confirmation toggle, providing the user with some context about the button they’re pushing


Or you could create an enum column inside your timesheet table, and use that as a “clock out” button inside the form.
You could use a ChangeTimestamp column that’s watching this enum column for whatever value you use for the button text - when it finds that text, say “Clock Out” it records the timestamp.
This would keep you inside the form, if you wanted, but requires a little more handling.

  • For the “Clock Out” enum column
    • show if: Context(“ViewType”) = “Form”
    • Only one option in the dropdown: “Clock Out” (or whatever)
    • Editable if: ISBLANK([_this])

Once you do that editable if statement, once they select the clock out option, they can’t unselect it - and if you base your timestamp on that then you get your clock time.

You could apply an additional show if to the button, only showing it when it’s blank - that way after they tap the clock out button, it disappears (maybe making the clock out time visible (but they can’t edit it as it’s a Change column and is controlled via the system)).

1 Like