I am getting a delegation problem in a Collect that is looping using For All
I have a list of Business Units in one SharePoint List. Each Business has a District Code, Each District code is managed by one user.
I then have another list that contains Risk Assessment header records, this contains the status of the assessment.
I need to populate a gallery with the Risk Assessment status for all Business Units (BUN)
I am using the follwing to get the details.
The first part gets the list of Business Units (BUN) thatthe user is responsible for, their district number is derived from the label:
ClearCollect(
DistrictBUNsCollect,
Filter(
Sites,
'Hierarchy 5 Code' = DistrictNumberLabel.Text
)
);
I then put this into a gallery.
The next part loops through each Business Unit (BUN) in the Gallery:
ForAll(
DistrictBUNGallery.AllItems,
Collect(
AllRiskAssessmentsThisDistrict,
Filter(
CovidRiskAssessAudit,
BUN = DIstrictGalleryBUNLabel.Text
)
)
)
It will only ever loop through the first 500 rows though, there may be 10s of thousands in the future so I need to find another method for do