Hello,
I need a help to make attendance tracker with QR barcode scanner in powerapps. I need to solve following issues but I couldn't make it by myself, so I need your helps.
1. The first time of scanning the barcode is arrival time and the last time of scanning barcode is departure time. To do that, how I can separate the records of both arrival time and departure time in sharepoint list in different column.
2. I need to patch my records to sharepoint list without any button, which means need to create autostart barcode scanner.
Thank you for your help.
Hi @Khulan ,
Am not knowing of your list columns, so I assume you have at least four columns: Attendees, Date, Arrival time and Departure time. When a user first time using the App to scan the QR code in a day, App should update the user info along with the date, and save scan time to the arrival time column; when second time scan the QR code in the same day, App should look up the user info from the list and save departure time to the Departure time column.
So, OnScan of Barcode Scanner could set to:
If(
IsBlank(
LookUp(YourList, Attendees = User().DisplayName && Date = Today())
),
Patch(
YourList,
Defaults(YourList),
{Attendees: User().DisplayName, Date: Today(), ArrivalTime: Now()}
),
Patch(
YourList,
LookUp(YourList, Attendees = User().DisplayName && Date = Today()),
{DepartureTime: Now()}
)
)
One point you need to note is, on the first time scanning in a day to prevent a second false scan, it's best to let the app navigate to another screen and inform the user a successful scan and the result. Otherwise, if someone scan twice quickly, they will get both arrival time and leave time populated to the list.
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional