Hi I'm getting my variable underlined in blue and this warning:
Delegation Warning. The "SortByColumns" part of this formula might not work correctly on large data sets
I'm using this formula:
SortByColumns(TestPeople,varSort,Descending)
Please advise,
Thanks
Solved! Go to Solution.
I got the answer...
With({wFilterRecords: Filter(NTSTestPeople,StartsWith(Name,txtFilterName.Text))},Switch(varSort,"crd79_name",SortByColumns(wFilterRecords,"crd79_name",If(blnSortDescending1,Descending,Ascending))))
I'm assuming that TestPeople is a person/group column. That's why you are getting the delegation warning. SortByColumns is only delegable for certain types of columns. A person/group column is a complex value and therefore isn't delegable.
I'm not sure why it is not delegable. It's just a text field on an entity.
Also, what are my options here? I don't what the sorting to fail when the dataset grows.
Thanks in advance.
Also, I'm not sure I understand the meaning of a complex data time. The person column is simply a text field in a custom entity I created. So I don't see what is 'complex' about it.
My answer was specific to SharePoint, not CDS. If you are using an entity you created and the field is just a text field then it should work. Complex fields would be things like option sets or lookups or objects with multiple properties. People are normally a complex object field because they usually contain properties for Names, emails, etc. Can you share the schema of the entity?
Sure, but first I noticed that the problem is with the 'varSort' variable.
SortByColumns(Filter(TestPeople,StartsWith(Name,txtFilterName.Text),StartsWith(Location,txtCity.Text),StartsWith(Code.Code,txtHobby.Text)),varSort,If(blnSortDescending1,Ascending,Descending))
if I replace the variable with a column name then the warning goes away:
SortByColumns(Filter(TestPeople,StartsWith(Name,txtFilterName.Text),StartsWith(Location,txtCity.Text),StartsWith(Code.Code,txtHobby.Text)),"crd79_person",If(blnSortDescending1,Ascending,Descending))
I got the answer...
With({wFilterRecords: Filter(NTSTestPeople,StartsWith(Name,txtFilterName.Text))},Switch(varSort,"crd79_name",SortByColumns(wFilterRecords,"crd79_name",If(blnSortDescending1,Descending,Ascending))))
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
212 | |
203 | |
83 | |
58 | |
38 |