How to set Clock-out should on the same date as Clock-in

I made a presence app to record faculty members and other staffs activity during Covid19 WfH. I manage using form to capture timestamp, clock-in, location, photos, activities, and clock-out. I wish to set the clock-out should be on the same date as clock-in. Is it possible if user forgot to clock-out it will automatically clocked-out by app on 23.59. I do appreciate for any comment and suggestion. I search that it is not possible at the moment to use server/system side trigger action to accomplish this.

Solved Solved
0 4 403
1 ACCEPTED SOLUTION

Thank you for the updates.

Since you have [Clock In] and [Clock Out] as TIME type columns, I believe the earlier suggested valid_if expression will not work.

Instead you may set the expression [Date]=TODAY() in Editable_if constraint of [Clock In] and [Clock out] columns.

This will ensrue that the user can edit these values only if the record creation date is today.

I believe , if your column type is Time, your initial value can be simply an expression as TIME(โ€œ23:59:59โ€)

Since [Clock Out] will always have an initial value of โ€œ23:59:59โ€ , you may have a slice expression something like

AND([Date]=TODAY(), [Clock Out]= TIME(โ€œ23:59:59โ€))

This will list all of todayโ€™s records where the user has yet not entered any other [Clock Out] time than the default initial time of โ€œ23:59:59โ€. Only lacuna of this slice filter expression is if a user has purposely entered [Clock Out] time of โ€œ23:59:59โ€ , then also it will be included in the โ€œWorking Nowโ€ slice.

View solution in original post

4 REPLIES 4

Hi @romanus,

It is not clear what type of column you have for [Clock in] and [Clock Out] . Presuming you have datetime type columns for [Clock in] and [Clock Out], you could have valid if constaint in the [Clock out] column as

Date[Clock out]= Date[Clock in]

Edit 2: My bad for a typo. Please have expression as

DATE([Clock out])= DATE([Clock in] )
The above constraint will ensure that the user enters the clock out time on the same day as Clock in

Also you may set โ€œinitial valueโ€ of [Clock Out] to expression
DATETIME(CONCATENATE(TODAY()," ", โ€œ23:59:59โ€))

This will ensure that if the user forgets to enter the clock out time, the initial value records the desired clock out time.

Edit: Alternatively, initial value of [Clock out] can be

DATETIME(CONCATENATE(DATE([Clock In])," ", โ€œ23:59:59โ€))

Thank your very much @Suvrutt_Gurjar for your reply and explanation.

I have my Clock-in=TIMENOW() and Clock-out empty both as Time, and I have another column of [Date]=TODAY().

I also set a View called โ€œWorking Nowโ€ from Slice showing users with filter if Clock-out is empty, so I can see a list of users Clock-in and currently working.

Then I will set initial value you suggested to DATETIME(CONCATENATE(DATE([Clock-in])," ", โ€œ23:59:59โ€)) as well as the View filter from slice mentioned above to [Clock-out]=โ€œ23:59:59โ€.

If the the date of TODAY and Time of 23:59:59 has passed, is the list of currently working users will automatically removed from โ€œWorking Nowโ€ View since it is not valid anymore?

Thank you for the updates.

Since you have [Clock In] and [Clock Out] as TIME type columns, I believe the earlier suggested valid_if expression will not work.

Instead you may set the expression [Date]=TODAY() in Editable_if constraint of [Clock In] and [Clock out] columns.

This will ensrue that the user can edit these values only if the record creation date is today.

I believe , if your column type is Time, your initial value can be simply an expression as TIME(โ€œ23:59:59โ€)

Since [Clock Out] will always have an initial value of โ€œ23:59:59โ€ , you may have a slice expression something like

AND([Date]=TODAY(), [Clock Out]= TIME(โ€œ23:59:59โ€))

This will list all of todayโ€™s records where the user has yet not entered any other [Clock Out] time than the default initial time of โ€œ23:59:59โ€. Only lacuna of this slice filter expression is if a user has purposely entered [Clock Out] time of โ€œ23:59:59โ€ , then also it will be included in the โ€œWorking Nowโ€ slice.

Thank you very much for the updated solutions @Suvrutt_Gurjar. Itโ€™s now the best solution for me!

Top Labels in this Space