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
Super User
Super User

You can nest your filtered results in a SortByColumns function:

SortByColumns(

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

, "Other Column")


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

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? 

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



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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