In my inventory app i have several ways of filtering my gallery list:
To make this possible, I use If sentences to decide what is shown in my gallery depending on all these inputs.
I have 10+ ways of filtering the list. Each code looks something like this:
inputFilterStatus.Selected.Result = "All" && inputFilterCategory.Selected.Result = "All" && inputFilterDepartment.Selected.Result = "All" && !varToggle1 && !varToggle2 && !SpecialFunction && !SpecialFunction2,
SortByColumns(Filter(Search([@'Equipment'],
inputFilterSearch.Text, "searchcolumn1","searchcolumn2"),
Location = myPlant),
varSortOn,If(SortDescending1, Descending, Ascending)),
I have a delegation warning on the varSortOn, which is the sorting variable.
I need the user to be able to change what they want to sort the list by.
I have read old threads here and searched online, but did not find the solution.
Have tried If / Switch sentence where the varSortOn is now.
Any suggestion on how to be able to choose a custom sort column and remove the delegation warning?
Each If sentence (10+) has varSortOn at the moment.
Your formula appears to be incomplete!
However, for the section you do show, SortByColumns is not delegable when you use a variable column name.
Also, Search is not delegable...so that is the base of the issue.
You can use the following to work around both the Search and SortByColumn delegation warning.
With({_items: Filter(Equipment, Location = myPlant)},
SortByColumns(
Search([@'Equipment'],
inputFilterSearch.Text, "searchcolumn1","searchcolumn2"
),
varSortOn,
If(SortDescending1, Descending, Ascending)
)
)
I hope this is helpful for you.
Thanks for the response!
Tried your code, but it still gives me two blue lines under varSortOn with the message:
Delegation warning. The "SortByColumns" part of this formula might not work correctly on large data sets.
Any suggestions? 🙂
I am using Dataverse as DataSource. So the search function does not give me delegation warning, only the "sort variable".
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
197 | |
47 | |
43 | |
41 | |
36 |
User | Count |
---|---|
287 | |
81 | |
80 | |
79 | |
71 |