cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JJJ04
Frequent Visitor

Sorting gallery when also filtering with IsBlank

Hello everyone,

 

Hoping someone can assist as I have tried other user's remedies but they don't seem to work for me.  I have a SharePoint list where it only pulls items to the gallery where the Review Complete column is blank.  This works perfectly however I want the results in the gallery to also be sorted in alphabetical order by another column (a choice field) in the same list.

 

This is what I currently have but not sure how to incorporate the sort feature:

 

Filter('Hotel Reviews', (IsBlank('Review Complete')))

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JJJ04
Frequent Visitor

@BCBuizer Okay i think i got it!  

 

Sort(Filter('Hotel Reviews',(IsBlank('Review Complete'))), Hotel.Value)

 

I changed it from "SortByColumns" to Just "Sort" and then added ".Value" after the column I wanted it sorted by. 

I am very new to Powerapps.  Is there a reason why your original formula didn't work but this did? 

View solution in original post

5 REPLIES 5
BCBuizer
Resolver III
Resolver III

You can nest your filtered results in a SortByColumns function:

SortByColumns(

Filter('Hotel Reviews', (IsBlank('Review Complete')))

, "Other Column")
JJJ04
Frequent Visitor

When i do that, the gallery comes up blank for some reason with no results?

JJJ04
Frequent Visitor

@BCBuizer Okay i think i got it!  

 

Sort(Filter('Hotel Reviews',(IsBlank('Review Complete'))), Hotel.Value)

 

I changed it from "SortByColumns" to Just "Sort" and then added ".Value" after the column I wanted it sorted by. 

I am very new to Powerapps.  Is there a reason why your original formula didn't work but this did? 

View solution in original post

zmansuri
Super User
Super User

 

SortByColumn(AddColumn(Filter('Hotel Reviews', (IsBlank('Review Complete'))),"OtherText",OtherColumn.Value),"OtherText",Ascending)

Changing from SortByColumns to Sort probably didn't fix it, but adding the ".value" did.

 

Looking at the syntaxis for SortByColumns, it needs a string to sort. Since the Hotel column is a of a record datatype, you can't use that "as is", but adding the ".value" does return a string and hence works.

 

More info on Sort and SortByColumns can be found here: 

 

Sort and SortByColumns functions in Power Apps - Power Apps | Microsoft Docs

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,279)