web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / set default sorting wh...
Power Apps
Unanswered

set default sorting when app open in gallery

(0) ShareShare
ReportReport
Posted on by 2

how do i sort a gallery by name with Filtered function and Search box and large data

At the moment the following is working, just can't add the sort and make it working, please help

 

 

If(
varDataCount < VarDelegationLimit,
Filter(
Filter(
Documents,
hiddenFolderPath = "xxxxx/xxx/xxx/xx"
),
TextInput2.Text in Name
),
Filter(
Documents,
(hiddenFolderPath = "xxxxx/xxx/xxx/xx")
)
)

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,844 Super User 2026 Season 2 on at

    Hi @KatieLiu ,

     

    The whole formula can be wrapped in a Sort function.

    Sort(
    	If(
    		varDataCount < VarDelegationLimit,
    		Filter(
    			Filter(
    				Documents,
    				hiddenFolderPath = "xxxxx/xxx/xxx/xx"
    			),
    		TextInput2.Text in Name
    		),
    		Filter(
    			Documents,
    			(hiddenFolderPath = "xxxxx/xxx/xxx/xx")
    		)
    	),
    	Name
    )
    
    

     

    However, there may be room for improving your existing formula by working around the delegation limit. The below will work as long as the number of items in the pre-filtered data does not exceed the Data Row Limit:

     

    Sort(	
    	With({
    		_PreFilteredData: Filter(
    			Documents,
    			hiddenFolderPath = "xxxxx/xxx/xxx/xx"
    			)
    		},
    		Search(_PreFilteredData, TextInput2.Text, "Name")
    	),
    	Name
    )

     

     

  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @KatieLiu ,
    Assuming there will be no more than your (500-2000) Delegation limit files in that folder, you can do this

    With(
     {
     wDocs:
     Filter(
     Documents,
     hiddenFolderPath = "xxxxx/xxx/xxx/xx"
     )
     },
     Sort(
     Filter(
     wDocs,
     TextInput2.Text in Name
     ),
     YourSortField,
     YourSortOrder
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard