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