Hi, Power apps legends.
My end-users have been complaining about the performance of my app, checking the monitor I noticed that a patch function is getting thousands of rows, as you can see the ID 1 is the click action on the button however the actual response is the ID 1569 WTH!!
The patch function is below.
If(
IsBlank(ProcessesGallery.Selected.EditingBy),
//TRUE VALUE EDITING BY IS EMPTY
Patch(
SharePointList,
//ProcessesGallery.Selected,
{ID: ProcessesGallery.Selected.ID},
{EditingBy: Text(User().FullName)},
{LockedAt: Now()}
);
If(
IsEmpty(Errors(SharePointList)),
//TRUE VALUE NO ERROR
Notify(
"Client was locked successfully",
NotificationType.Success,
2000
);
Set(
Process,
ProcessesGallery.Selected
);
Navigate(
EditFormScreen
),
//ELSE VALUE NO ERRORS
Notify(
First(Errors(SharePointList)).Message,
NotificationType.Error,
2000
);
Patch(
SharePointList,
ProcessesGallery.Selected,
{EditingBy: Blank()},
{LockedAt: Blank()}
)
),
//ELSE VALUE EDITING BY IS EMPTY
Notify(
"This process is being edited by " & ProcessesGallery.Selected.EditingBy,
NotificationType.Error,
2000
)
)

Furthermore, I noticed that the control called ErrorMessage32_4, which is a label, in the record 1572 is placed on another screen so why it's coming up here??
Any help would be appreciated!!