Hi everyone,
I have developed an attendance monitoring application which takes the clock in or clock out time as current time from the device, however, there is way to falsify the information where if user changes the device time manually it gives the wrong values, is there any way where time/date can be made fixed not dependent on the device.
Thanks,
If you have a paid plan, you can use a server side workflow. When you take the current time inside a workflow it will always return the current time as UTC+0, which cannot be manipulated by the user. You would just need to apply a timezone offset correction before saving it.
Thanks for the quick response Darren, would you be able to explain a bit more what needs to be done in workflow so that I can follow those instructions. for now I have just created form where information is being taken and clock In time is set to be current time.
Okay.
Firstly, you will need to know which time zone each of your users are in, and store that in the User Profile row as a number. eg. if a user is UTC+5, then you would store the number 5 for that user.
Change the action on the button so that it triggers either a manual or webhook triggered workflow, and pass the Users RowID as a parameter. In your workflow, you should have something like the following:
- A query that targets the Users table, and filters by the RowID that is passed with the trigger. Make sure you don’t select multiple.
- A lookup to fetch the offset value via the query
- A math step to calculate the adjusted current time:
Now + Offset/24
, where Offset
is the value returned by the lookup.
- A query to find the row in the table that needs to be updated (where the time should be set)
- A Set Column Values step that sets the time via the previous query.
The above is just off the top of my head, so I haven’t tested it. But I believe it should work.
1 Like
great thanks, I will use it and see how does it works, however, I was going through the documentation as well where glide mentioned that the current date/time feature inside the form takes server time but In my case it is manipulated if device time is changed.