I have a couple of attendance apps for different reasons that all write to the same table called Daily Activity Attendance. Up until this point my technique of If(Blank(LookUp())) record is true patch existing or create new has worked pretty reliably. I have a new app that I made in last few weeks that has been having duplication issues. I am wondering if anyone can tell me what I am missing?
I have a gallery of students. In that gallery is a Icon that for OnSelect says:
If(
IsBlank(
LookUp(
'[dbo].[Today Activity Attendance Unfiltered]',
DailyAttUID = 'User ID' && AttendanceDate_x0020_String = TodayVar
)
),
Patch(
'[dbo].[Daily Activity Attendance]',
Defaults('[dbo].[Daily Activity Attendance]'),
{
DailyAttUID: 'User ID',
AttendanceDate: Today(),
AfterBusRoom: 1,
AfterBusRouteID: LookUp(
LocalRoutes,
Bus_x0020_Route = BusFinal,
BusRouteID
),
AfterStopID: LookUp(
LocalStops,
Stop_x0020_Name = StopFinal && Time = "Afternoon",
StopID
),
SignoutTime: Text(
Now(),
"[$-en-US]hh:mm:ss"
)
}
),
Patch(
'[dbo].[Daily Activity Attendance]',
LookUp(
'[dbo].[Daily Activity Attendance]',
DailyAttUID = 'User ID' && AttendanceDate_x0020_String = TodayVar
),
{
AfterBusRoom: 1,
AfterBusRouteID: LookUp(
LocalRoutes,
Bus_x0020_Route = BusFinal,
BusRouteID
),
AfterStopID: LookUp(
LocalStops,
Stop_x0020_Name = StopFinal && Time = "Afternoon",
StopID
),
SignoutTime: Text(
Now(),
"[$-en-US]hh:mm:ss"
)
}
)
)The table at the top is a SQL View that is:
SELECT DailyAttUID, [AttendanceDate String]
FROM dbo.[Daily Activity Attendance] AS att
WHERE (AttendanceDate = CAST(DATEADD(hour, - 8, GETDATE()) AS DATE))
It seems like if the user taps the button fast enough it creates multiple records. Within 10 seconds it seems. I am wondering if it is running command in parallel? If so can I stop it or maybe deal with it?