cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Help with filter on Gallery

FYI: when using SortByColumns the second parameter (in this case Group) needs to be in double quotes ("Group"). Also PowerApps uses the internal SharePoint field name which is the name it was given when it was created. Anytime you change a field name in SharePoint you are just changing the display name.

 

Why do you have "Category.Selected.CategoryName"? I thought CategoryName was a rename of the Title field in "Store Data - Categories", so it should be called "Category.Selected.Title".

 

I don't understand how you are changing the field "Group" to "GroupLabel" in the Gallery.

 

Lets try and simplify it to see if we can get it working.

 

Filter('XXXXX Store', Group = Category.Selected.Title)

'XXXXX Store' needs to be changed to the actual name of the list but don't change anything else. After the code is in and if there are no errors then click on category and see if it filters.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
UserInterface7
Level: Powered On

Re: Help with filter on Gallery

"Category.Selected.CategoryName" Um. I was just trying different combos, but that made the field highlight as below. But your right it should be title. Think I went down the rabbit hole with that one when I tried too many things this morning

Highlight.png

 

I don't understand how you are changing the field "Group" to "GroupLabel" in the Gallery.

When I create the gallery, it gives the field some generic name like Label4 etc, I am just right clicking and selecting rename to give it a name I recognise.

 

Trying the below works as expected.

Filter('XXXXX Store', Group = Category.Selected.Title)

 

 

 

 

UserInterface7
Level: Powered On

Re: Help with filter on Gallery

When i try this, it works. 

SortByColumns(
Filter(
'XXXXX Store',
Group = Category.Selected.Title
),
"Group"
)

 

Seems to be just an issue with the sort.

If(SortDescending1, Descending, Ascending)

Highlighted
Super User
Super User

Re: Help with filter on Gallery

Changing the control name to GroupLabel doesn't impact the how we are trying to use Group which is actual field name.

 

If you haven't a variable called SortDescending1 that explains why it said the if statement was invalid.

 

You can still sort by doing this:

 

SortByColumns(
Filter(
'XXXXX Store',
Group = Category.Selected.Title
),
"Group",
Ascending
)

 

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

UserInterface7
Level: Powered On

Re: Help with filter on Gallery

Thank you! 

That works, I think I was getting confused with using the label name vs the actual SP list column name. Also, changing the sort as you suggested works.

 

Thanks for your time, I just couldn't get my head around it. The other mistake I made was that renaming the column in SP wasn't changing the name. That was my biggest mistake I think. 

I'll just have to work out how to clear the filter again to show all options again if they want but that can wait for now.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,399)