Good Afternoon,
I am working on a powerapp that is currently small but I expect to be well over 10k records within a year of use.
To that end, I'm trying to pre-emptively avoid issues down the line.
I guess I'm either not understanding Delegation or ClearCollect or am butchering the syntax. (Likely Both.)
Currently to pull my data I can use this formula code:
Filter(Rosters, Gallery2.Selected.ClassTypeText = ClassTypes.Value ,Text(ClassDate,ShortDate) = Text(DatePicker1,ShortDate) )
My thought process is that on any given day we would only have maybe 50-300 records. So If I could presort the table based on the date picker, it would hopefully make this responsive/quicker and down the road when I do have 10k+ records, it won't start to work at a snails pace.
ClearCollect(DateCollection,Filter(Rosters,Text(ClassDate,ShortDate) = Text(DatePicker1,ShortDate));
Filter(Rosters, Gallery2.Selected.ClassTypeText = ClassTypes.Value)
Solved! Go to Solution.
If you can use Filter() to get your data source below the data row limit then you don't need ClearCollect. If you can't then ClearCollect won't help. The key here is to use nested Filter() statements that are delegable to get your data set below the data row limit, then apply non-delegable functions to that data set. For example,
Filter(Filter(Rosters, Gallery2.Selected.ClassTypeText = ClassTypes.Value),Text(ClassDate,ShortDate) = Text(DatePicker1,ShortDate));
Hi @Leon_D ,
Firstly, you need SeletedDate on the Date Picker, but if ClassDate is a Date only field (not time), you just need this
Filter(
Rosters,
ClassTypes.Value = Gallery2.Selected.ClassTypeText &&
ClassDate = DatePicker1.SelectedDate
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
If you can use Filter() to get your data source below the data row limit then you don't need ClearCollect. If you can't then ClearCollect won't help. The key here is to use nested Filter() statements that are delegable to get your data set below the data row limit, then apply non-delegable functions to that data set. For example,
Filter(Filter(Rosters, Gallery2.Selected.ClassTypeText = ClassTypes.Value),Text(ClassDate,ShortDate) = Text(DatePicker1,ShortDate));
Another option is to use Dataverse or Sql as a connected source. Delegation is not as much of an issue with those.