cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EriSto
Helper II
Helper II

How to filter based on selected dropdown value

Hi all.

 

I added a choice column to my SharePoint list to specify if an activity is "Open" or "Closed".
I added a dropdown list on my dashboard screen, which has the column i mentioned above as the items.

 

So far, so good. Where I'm running into a problem, is filering by the seleted value in the dropdown. I just haven't been able to figure out how to code it into my gallery filter. 

 

I attached the code I currently use, that only uses the search field text (see below). Any tips on how I can make it filter based on the selected dropdown, and text? Ive been playing around trying to make it work for hours but I am getting nowhere. 

 

Thanks for your time.

 

SortByColumns(
    Filter(
        Activity_Reports,
        StartsWith(
            ES_Nr,
            TextSearchBox1.Text
        ) || StartsWith(
            SK_Fnr,
            TextSearchBox1.Text
        )
    ),
    "Created",
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@EriSto 

You should be able to accomplish the FILTER by adding another criteria for the dropdown like this.

SortByColumns(
    Filter(
        Activity_Reports,
        StatusColumnName.Value = Dropdown_Status.Selected.Value,
        StartsWith(
            ES_Nr,
            TextSearchBox1.Text
        ) || StartsWith(
            SK_Fnr,
            TextSearchBox1.Text
        )
    ),
    "Created",
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@EriSto 

You should be able to accomplish the FILTER by adding another criteria for the dropdown like this.

SortByColumns(
    Filter(
        Activity_Reports,
        StatusColumnName.Value = Dropdown_Status.Selected.Value,
        StartsWith(
            ES_Nr,
            TextSearchBox1.Text
        ) || StartsWith(
            SK_Fnr,
            TextSearchBox1.Text
        )
    ),
    "Created",
    If(
        SortDescending1,
        Ascending,
        Descending
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

That was it, thank you so much @mdevaney !

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,458)