Hi there!
I'm still new to PowerApps and working on a QR scanner to use as a time clock for our team. Thanks to the help of the wonderful people on this forum we have got this working 😀
At present we issue a QR code to everyone which splits into Name;WorkArea;ID on scan and using one button in PowerApps to "Clock In" and "Clock Out" everyone.
One issue I would like to learn how to work around is what happens if someone clocks in or out multiple times in a day e.g. they have scanned in to start the day then scanned out and then have had to come back to work. At present when someone "Clocks In" they create a new Sharepoint record - when they "Clock Out" the LookUp works brilliantly and records the time in "Clock Out Time Stamp". However if they scan the QR Code again after a time already exists in the "Clock Out Time Stamp" on the same day it will just flat out overwrite today's record with an updated time and I need it to create a whole new entry in Sharepoint.
I've tried a few things but I'm lost as to how to get this to happen around everything else...if anyone could point me in the right direction that would be extremely helpful!
Screenshots of columns in Sharepoint with examples - OnScan of the BarcodeReader current formula below. Any help would be massively appreciated and thanks in advance to anyone who takes a look!
With(
{
_Title:
Last(FirstN(
Split(
First(BarcodeReader1_1.Barcodes).Value,
";"
),1
)).Value,
_Area:
Last(FirstN(
Split(
First(BarcodeReader1_1.Barcodes).Value,
";"
),2
)).Value,
_HoddyID:
Last(FirstN(
Split(
First(BarcodeReader1_1.Barcodes).Value,
";"
),3
)).Value
},
With(
{
_Exist:
LookUp(
'Ahoy Staff 2024',
Title = _Title && 'Work Area' = _Area && HoddyID = _HoddyID && DateOnly = Today()
)
},
If(
!IsBlank(_Exist.ID),
Patch(
'Ahoy Staff 2024',
{ID: _Exist.ID},
{'Clock Out Time Stamp': Now()}
),
Patch(
'Ahoy Staff 2024',
Defaults('Ahoy Staff 2024'),
{
Title: _Title,
'Work Area': _Area,
HoddyID: _HoddyID,
DateOnly: Today(),
'Clock In Time Stamp': Now()
}
)
)
)
);
Navigate(Successimo);
Set(
startTimer2,
true
)
Thanks