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

Community site session details

Session Id : vPnbpxpJ3dMa4R6bGCXCqz
Power Apps - Building Power Apps
Answered

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

Like (2) ShareShare
ReportReport
Posted on 5 Jul 2024 16:33:55 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.

I have the same question (0)
  • KeithAtherton Profile Picture
    3,690 Most Valuable Professional on 05 Jul 2024 at 16:50:20
    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.

  • Verified answer
    WarrenBelz Profile Picture
    151,827 Most Valuable Professional on 06 Jul 2024 at 02:54:03
    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
     )
    )

     

  • csouza123 Profile Picture
    43 on 09 Jul 2024 at 10:34:50
    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.

  • WarrenBelz Profile Picture
    151,827 Most Valuable Professional on 09 Jul 2024 at 11:42:29
    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 09 Jul 2024 at 13:11:54
    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

  • csouza123 Profile Picture
    43 on 09 Jul 2024 at 16:46:14
    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 09 Jul 2024 at 16:58:27
    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!

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete