Lets Make Sorting EASY in Power Apps with no Delegation Errors

Опубликовано: 24 Ноябрь 2024
на канале: Andrew Hess
5,021
85

Let's make SortByColumns in Power Apps easy. The key to doing filters and sort together is organization. In this video I will show you how to make sorting with a SharePoint data source easy. Just format and boom done! No delegation errors.

Also, I forgot to say during the video, on the OnVisible Property of the Screen with the Gallery you should set the varSort to the SharePoint list, MyTasks.

Formula:
Switch(varSort,
"Title",SortByColumns(If(drpLabels.Selected.Result="",MyTasks,Filter(MyTasks,drpLabels.Selected.Result=TaskLabel)),"Title",Ascending),
"DueDate",SortByColumns(If(drpLabels.Selected.Result="",MyTasks,Filter(MyTasks,drpLabels.Selected.Result=TaskLabel)),"DueDate",Ascending),
"TaskType",SortByColumns(If(drpLabels.Selected.Result="",MyTasks,Filter(MyTasks,drpLabels.Selected.Result=TaskLabel)),"TaskType",Ascending),
"TaskLabel",SortByColumns(If(drpLabels.Selected.Result="",MyTasks,Filter(MyTasks,drpLabels.Selected.Result=TaskLabel)),"TaskLabel",Ascending)
)


Chapters:
0:00 Introduction
2:07 Using a simple sort statement
3:00 Using a secondary sort
4:00 Adding sort icons
5:00 Showing delegation issues with sortbycolumns
6:48 Using a Switch() Statement instead
9:00 Adding back our If() Statement
10:55 Conclusion