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

Filter Gallery based on Combobox

Hi,

 

I know that there are several topics/post out the covering this question, but i have tried multiple variations for filtering a Gallery based on a Combobox in Powerapps

 

The combobox itself works fine, i have applied the following formula: Choices(Tablename.Columnname)

 

For the Gallery i have tried this formula: Filter(Tablename;Columname = ComboBox1.Selected.Value)

 

Ive tried different variations of selecteditems,.Value, Selecteditems only etc - nothing seems to work for me. 

 

Also i noted that others are using , or . where im using ; - but powerapps seems to want me to use ; - is this region specific?

 

Any help would be appreciated

 

BR

Kristian

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @Krelz9210 

 

1. Change to Afdeling.Value

2. Sorting use any other column since you are filtering

With(
    {
        wCode: Sort(
            Filter(
                Afvigelsesblanket,
                (IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || Afdeling.Value = ComboBox1.Selected.OfficeLocation)
            ),
            Title,
            Descending
        )
    },
    wCode
)
  •  

View solution in original post

11 REPLIES 11
StalinPonnusamy
Community Champion
Community Champion

Hi @Krelz9210 

 

Gallery Filter and Sort

 

With(
    {
        wCode: Sort(
            Filter(
                TableName,
                (IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || ColumnName = ComboBox1.Selected.Value)
            ),
            Columnname,
            Descending
        )
    },wCode
)

 

StalinPonnusamy
Community Champion
Community Champion

Hi @Krelz9210 

 

Sample filter with Search, Sort, and Combo filter

With(
    {wCode: 'Issue tracker'},
    Sort(
        Search(
            Filter(
                wCode,
                (IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || Priority.Value = ComboBox1.Selected.OfficeLocation) && (StatusDropdown.Selected.Value = "All" || Status.Value = StatusDropdown.Selected.Value)
            ),
            TextSearchBox1.Text,
            "Title"
        ),
        Created,
        Descending
    )
)

 

If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

image.png

 

Does not seem to work for me, powerapps is not happy with the commas , (notice the red underlining) and in the "guide" for how to use the filter it suggests using ; - however if i use ; the ComboBox is underlined with red indicating an error. 

 

Like so: 

 

image.png

 

StalinPonnusamy
Community Champion
Community Champion

Try this

With(
    {wCode: 'Issue tracker'},
    Sort(
        Filter(
            wCode,
            (IsBlank(ComboBox1.SelectedItems) || IsEmpty(ComboBox1.SelectedItems) || Priority.Value = ComboBox1.Selected.OfficeLocation)
        ),
        Created,
        Descending
    )
)

No luck unfortunatly 😞

StalinPonnusamy
Community Champion
Community Champion

Hi @Krelz9210 

 

If the column you are filtering is a Choice column in Source then you need to add .Value

 

Priority.Value = ComboBox1.Selected.OfficeLocation

or

Priority.Value = ComboBox1.Selected.Value

 

What is your combobox Value?

StalinPonnusamy
Community Champion
Community Champion

Hi @Krelz9210 

  • Please share the Column type that you are filtering
  • And Combo box Items property

So that we can change the filter criteria

ComboBox item = Choices(Afvigelsesblanket.Afdeling)  

so that translates to Choices(Tablename.Columname)

 

Column source is a Sharepoint Choice column 

This formula seems to work 

 

Filter(Afvigelsesblanket, Afdeling in ComboBox1.SelectedItems) 

Suddenly seems to work

 

However ofcourse a bit annoying no cases are shown when no filter is selected

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

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