Hi all,
I have with an update operation with two SharePoint Lists. The first List 'SiteGroups' is the master table and each time there is a change in this table, there have to be created a record in the second table 'ActionQueue'. The table ActionQueue acts as queue for further processess. As long as an action is not completed the record in SiteGroups is locked against further changes.
When the user changes a record in the SiteGroups and doesn't stop the running PowerApp session , the code will create the required entry in the ActionQueue table. But when the PowerApp session terminats before, there could be changes in SiteGroups, without an corresponding entry in ActionQueue.
The intention of the following code block is to fix this issue
ClearCollect(
colCheckSiteGroups;
Filter(SiteGroups; paProcessStatus = "waiting"; ActionID = 0)
);
ForAll(
colCheckSiteGroups;
Patch(SiteGroups;
LookUp(SiteGroups; ID = colCheckSiteGroups[@ID]);
{ActionID:
Patch(ActionQueue;
Defaults(ActionQueue);
{
PendingAction: colCheckSiteGroups[@PendingAction];
ActionForListID: colCheckSiteGroups[@ID]
}
).ID
}
)
)
Unfortunatly the PowerApp studio comes up with a delegation warning, which a highlighted in blue. With a small amount of records it works fine, but not with a larger amount, which have to be expected. I tried to populate the colCheckSiteGroups; collection with a FirstN statement, but that doesn't help.
Could you please give me a suggestion how to fix this issue?
Kind regards
Chris