web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter a collection wi...
Power Apps
Suggested Answer

Filter a collection with regex

(0) ShareShare
ReportReport
Posted on by
Hello,
i have a collection with two collums
 
A B
Card10G SFP10G_1
Card1G SFP10G_2
  SFP1G_1
  SFP1G_2
   
 
And I have two dropdown menues.
If the user selects "Card1G" in dropdown 1, dropdown 2 items should be limited to all entrys from collum containing "^.*1G.*$" and vice versa.
 
How can i achive this in power apps?
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at

    You can achieve this by using a collection and filtering the second dropdown based on the first dropdown selection.

    For Example:

    Sample collection:

    ClearCollect(
        colCards,
        {A:"Card1G", B:"SFP1G_1"},
        {A:"Card1G", B:"SFP1G_2"},
        {A:"Card1G", B:"SFP1G_3"},
        {A:"Card10G", B:"SFP10G_1"},
        {A:"Card10G", B:"SFP10G_2"},
        {A:"Card10G", B:"SFP10G_3"},
        {A:"Card25G", B:"SFP25G_1"},
        {A:"Card25G", B:"SFP25G_2"},
        {A:"Card35G", B:"SFP1G_5"}
    )
    First combobox items property code: (Assuming this Combobox control name is: A_Combobox)
    Distinct(colCards, A)

    Second combobox item property code

    Distinct(
        Filter(
            colCards,
            IsBlank(A_Combobox.Selected.Value) ||
            Substitute(A_Combobox.Selected.Value, "Card", "") in B
        ),
        B
    )

     

     
    ---------------------------------------------------------------------------
    Glad it helped 🙂
    If this fixed your issue,
    please click “Does this answer your question?” to mark it as verified so others can find the solution easily.
    A Like 👍 is always appreciated, and I’m around if you need more help @Kalathiya
  • MarkRahn Profile Picture
    1,418 Super User 2026 Season 1 on at
     
    Here is the YAML code you can cut and paste into your app:
     
          - Dropdown1:
              Control: Classic/DropDown@2.3.1
              Properties:
                Items: =["","Card10G","Card1G"]
                Items.Value: =Value
                X: =189
                Y: =99
          - Dropdown2:
              Control: Classic/DropDown@2.3.1
              Properties:
                Items: |+
                  =Search(
                      Table(
                          {Value:"SFP10G_1"},
                          {Value:"SFP10G_2"},
                          {Value:"SFP1G_1"},
                          {Value:"SFP1G_2"}
                      ),
                      Substitute(Dropdown1.Selected.Value,"Card",""),
                      Value
                  )
                Items.Value: =Value
                X: =189
                Y: =165
     
    The second dropdown does a Search in the available choices to limit them. The code uses the Substitute() function to remove "Card" from the choice from Dropdown1 to get the text you want to Search for.
     
    This community is supported by individuals freely devoting their time to answer questions and provide support. They do it to let you know you are not alone. This is a community.

    If someone has been able to answer your questions or solve your problem, please click Does this answer your question. This will help others who have the same question find a solution quickly via the forum search.

    If someone was able to provide you with more information that moved you closer to a solution, throw them a Like. It might make their day. 😊

    Thanks
    -Mark

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard