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
Community Champion
Community Champion

 

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,878)