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 / Can't filter a gallery...
Power Apps
Answered

Can't filter a gallery on a subtable

(0) ShareShare
ReportReport
Posted on by 27

Hi everyone,

 

I'm having trouble filtering a gallery and i would like your help !

 

Using a TextSearchBox, I would like to filter a table called "OUTILS" by using a field called "SITE" in the subtable called "OUTILS_SITE":

 

laurent68000_1-1697031029966.png

In my gallery I use Concat(Filter([@OUTILS_SITES];'ID OUTILS' = ThisItem.ID);SITE.Value) to  get all the sites of each record in the label. So i thought i could use it to filter on the field "SITE": but it doesn't work:

Filter([@OUTILS]; TextSearchBox.Text in Concat(Filter(OUTILS_SITES; 'ID OUTILS'= ID);SITE.Value))

Could you help my correct the formula or maybe there's a better solution?

 

Thank you !!

Categories:
  • bnastase Profile Picture
    17 on at

    I think a lookup would be better for this case:
    Filter( OUTILS, Not( IsBlank( LookUp( OUTILS_SITES, 'ID OUTILS' = OUTILS[@ID] && SITE.Value = TextSearchBox.Text ) ) ) )

  • laurent68000 Profile Picture
    27 on at

    It works 🙂 but :

    • If the searchbox is empty, so is the gallery (but i can find a workaround)
    • I wish i hadn't have to enter the entire word to get a result

    Do you have a workaround the latter?

  • Verified answer
    bnastase Profile Picture
    17 on at

    Okay.

     

     Filter(

        OUTILS,

        If(

            IsBlank(TextSearchBox.Text),

            true,

            Not(

                IsBlank(

                    LookUp(

                        OUTILS_SITES,

                        'ID OUTILS' = OUTILS[@ID] && InStr(SITE.Value, TextSearchBox.Text) > 0

                    )

                )

            )

        )

    )

     

    So for number one we can add a condition to check if the TextSearchBox is empty. If it's empty, we can show all results; otherwise, we'll filter based on the entered text. For number two instead of checking for an exact match, we can check if the SITE.Value contains the search text. This will allow for partial word matches.

     

    Let me know if this works,

    Bobby

  • Verified answer
    laurent68000 Profile Picture
    27 on at

    I just replaced InStr with Find and added Lower to help get a match  :

     

    Filter(

    Outils;

    If(

    IsBlank(TextSearchBox1_8.Text);

    true;

    Not(

    IsBlank(

    LookUp(

    Outils_sites;

    'ID application' = Outils[@ID] && Find(Lower(TextSearchBox1_8.Text);Lower(Site.Value)) > 0

    )

    )

    )

    )

    )

     

    It works perfectly now, thank you so much i've been stuck on this for hours !!!

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard