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 10 699
10 REPLIES 10

Steve
Platinum 4
Platinum 4

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?

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.

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.

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

Pretty much the same way.

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

Hi,

I followed your instructions but I dont see any button in the form. Do I miss out something?

Actions aren’t visible inside the form, they’re for modifying data outside in the other view types.

My suggestion was to move the “clock out” mechanism to an action, visible on the detail view (or possibly a table or other inline view) that the user can tap to clock out faster than having to go through the form.

Hi,

Is there a way to be edited in the form instead?


If I understand correctly: you want the [End Time] to not be editable when they user is first creating the record, but editable when they edit the record again, but not after they enter the time. Yes?

First: I wouldn’t even SHOW the [End Time] during the initial record creation, only show it when they come back to edit the record.

There are many different ways to skin a cat, but perhaps the easiest would be to base things off timestamps. For example: the following formula will hide the column, but only for the first minute after the record was created if put in the Show If space:

NOW() >= ([Timestamp] + "000:01:00")

You can easily adjust the time window by changing the duration you’re adding to the timestamp.

Second: I would restrict the [End Time] columns editability for ONLY when it’s blank, some time has elapsed since the record was created.

I would put the following formula inside the Edit If space:

and(
  isblank([_this]),
  NOW() >= ([Timestamp] + "000:01:00")
)
Top Labels in this Space