Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?
SaaS
What do you need help with?
Hey everyone!
I’m building a time-tracking system for the volunteers at my non-profit and could really use some advice.
I’ve put together a simple app that scans NFC cards and sends the volunteer’s ID to Baserow. Each scan creates a new row with the current date and time.
Now I’m a bit stuck on the actual time-tracking logic. I’m not sure whether this is better handled with formulas or with automations.
What I’m trying to achieve is something that looks at the last recorded timestamp for the same volunteer ID and calculates the worked duration. I also need to account for multiple clock-ins/outs per day (for example, a lunch break in the middle).
Has anyone built something similar or has suggestions on the best approach?
Thanks a lot! 
Please attach screenshots or videos if they help illustrate your question.
@frederikdc we’ll need your input here 
I would suggest to use a small automation here that decides to either:
- Create a new record when the volunteer checks in
- Updates an existing record when the volunteer checks out
This means that you would need to alter the table structure so that you have a field for Check-in time and one for Check-out time.
Step by step
- A new record is created because the volunteer is scanned
- Count the number of records where the user has a check-in time, but no check-out time:
- If this is 2 (an existing one + the one created to trigger the automation)
- Select the first record (it will always be the first one if you sort ascending on the check-in time)
- Update that record to set the check-out time to the current time using the
now() function (or use the check-in time from the newly created record)
- Important: also delete the newly created record because it is no longer needed and it would disturb the logic in future triggers
- If this is 1 (only the newly created one):
- That’s fine, no further action required.