Full credit to Matthew Devaney for this. His site has a great list of methods for getting around delegation issues. The ForAll solution is easy to overlook, but is perfect for my needs. Rather than pulling in ALL tickets and then applying filters, I’m able to only bring in tickets with the status matching the selected filters. This is a huge speed benefit.
The code provided in Matthew’s site is here:
Clear(colYourCollectionName);
ForAll(
["New", "Submitted", "Approved"],
Collect(
colYourCollectionName,
Filter('SharePoint List', SubmissionStatusColumn=Value)
)
);
My App has a Combo Box listing different statuses based on the status column
Choices('SharePointList'.'Status Column')
Then the default selected items is all except Closed, unless a parameter has been used when loading the app
If(
!IsBlank(Param("ticket")),
[varTicketDeepLink.'StatusColumn'.Value],
Filter(Choices('SharePointList'.'Status Column'),Value<>"Closed")
)
Then I have my modified code in the OnChange of my Combo Box. Rather than having a list of statuses, it uses the SelectedItems from the combo box. I’ve added Sort so that the most recent tickets are pulled in first (if there ever was a status with over 2000 tickets)
Clear(colTickets);
ForAll(
ComboBox1.SelectedItems,
Collect(
colTickets,
Sort(Filter('SharePoint List', 'Status Column'.Value=Value),ID,SortOrder.Descending)
)
);
This same code is also in the screen OnVisible, and anywhere I want a refresh
And immediately updated to make it so that the ComboBox was pulling into from the SharePoint List using Choices rather than using a hard code list