Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Selected items of people filter in Power Apps changes the filter result

(2) ShareShare
ReportReport
Posted on by 43

Good afternoon,

I need to make a filter of people, but I am dealing with a problem.

If I input  "Max" and "Josh" on the filter, when I use the filter searching in other order, like "Josh" and "Max", the filter don't recognize the names.

See below the images for better understanding.

WhatsApp Image 2024-07-05 at 13.28.07.jpegWhatsApp Image 2024-07-05 at 13.27.25.jpeg

The order of the names inputed, changes the filter result.

Filter(
    solucoes_tech_mainbase,
    Or(
        TextInput1_2.Text in 'Nome da Solução',
        TextInput1_2.Text in Descrição
    ) && Concat(
        ComboBox1_1.SelectedItems,
        DisplayName & ","
    ) in Concat(
        NomeCriador,
        DisplayName & ","
    ) && Concat(
        ComboBox2_1.SelectedItems,
        Value & ","
    ) in Concat(
        'Tecnologias envolvidas',
        Value & ","
    )
)

That's the code I'm using to filter, but the only part related to this specific problem, is ComboBox1_1.

 

If you want to have more informations, please feel free to ask.

  • csouza123 Profile Picture
    43 on at
    Re: Selected items of people filter in Power Apps changes the filter result

    I found the problem, the name of the columns was different for some reason, but I figured it out.

    Thanks for the help, I own you one!

     

  • csouza123 Profile Picture
    43 on at
    Re: Selected items of people filter in Power Apps changes the filter result

    Doing some tests here, I noticed that the filter is actually working now, but for some reason the values of the "ThisItem" formula are not bringing the information they are supposed to.

    They are just bringing empty values for all the rows.

    csouza123_0-1720543298360.png


    As you can see here, there are 2 rows that are coming with the filters, that's exactly the quantity that I expected.

    I'm not sure why the values are not showing up, but the filter formula is working now.

    Ignore the errors on the picture, there is a pop up there.

    Do you have any idea of how can I get the values back on the gallery?

  • csouza123 Profile Picture
    43 on at
    Re: Selected items of people filter in Power Apps changes the filter result

    The code is not showing errors anymore, thanks!

    But now, I cannot see any item on the gallery

    csouza123_0-1720530662818.png

    Even if I use the filters, the gallery still not show any rows

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Selected items of people filter in Power Apps changes the filter result

    @csouza123 ,

    Please see small correction in third line.

  • csouza123 Profile Picture
    43 on at
    Re: Selected items of people filter in Power Apps changes the filter result

    Good morning,
    Thanks for helping me on this issue @WarrenBelz and @KeithAtherton !
    Answering to Keith's question, if I use the formula that he said, the filter does not work, I've already tried it.

    About Warren's formula, I tried it but i got some errors.

    Find attached the message I received when I try the formula.

  • Verified answer
    WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Selected items of people filter in Power Apps changes the filter result

    HI @csouza123 ,

    Adding to to @KeithAtherton 's comments if you are trying to do a many-to-many filter here, you need to approach this differently as per the example below as "one side" of the comparison needs to be a single value querying a Table on the other.

    With(
     {
     _Data,
     Ungroup(
     ForAll(
     ComboBox1_1.SelectedItems As _Item1,
     Filter(
     solucoes_tech_mainbase,
     (
     TextInput1_2.Text in 'Nome da Solução' ||
     TextInput1_2.Text in Descrição
     ) &&
     _Item1.DisplayName in NomeCriador.DisplayName
     )
     ),
     Value
     )
     },
     Ungroup(
     ForAll(
     ComboBox2_1.SelectedItems As _Item2,
     Filter(
     _Data,
     _Item2.Value in 'Tecnologias envolvidas'.Value
     )
     ),
     Value
     )
    )

     

  • KeithAtherton Profile Picture
    3,646 Most Valuable Professional on at
    Re: Selected items of people filter in Power Apps changes the filter result

    Hi @csouza123,

     

    The issue may be that the following code concatenates all ComboBox1_1.SelectedItems into a single string, e.g. "Max,Josh,":

    Concat(ComboBox1_1.SelectedItems, DisplayName & ",")

     

    This means that when we compare it with another string, that exact string (e.g. "Max,Josh,") must match in the other string.

     

    However, what happens if you change that code to the following to compare NomeCriador with all items in ComboBox1_1.SelectedItems?:

    NomeCriador in ComboBox1_1.SelectedItems

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Connect with me online.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard