Seeking guidance on punch-in/punch-out workflow with Firestore

Actions & Logic

Hi FlutterFlow Community,

I need help setting up a punch-in and punch-out workflow. Here's the scenario:

When a user punches in, a new document is created in Firestore with the following structure:

json

CopyEdit

{ "location": "x,y", "punchintime": "12:02:28", "punchouttime": "", "totalDuration": 0 }

My question is: How can I ensure that when the user punches out, the app updates this same document (instead of creating a new one) to record the punch-out time and total duration?

Would appreciate any insights or guidance. Thanks!

What have you tried so far?

on punch out action, I try to call the last document created but I always find that as a mismatch

Did you check FlutterFlow's Documentation for this topic?
No
1