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 Gallery by 3 ot...
Power Apps
Unanswered

Filter Gallery by 3 other Gallery

(0) ShareShare
ReportReport
Posted on by 23

I have the main Gallery and 3 other galleries for filter
M trying to filter the main gallery based on the title selection of the other three gallery

 

Tried the below logic but didn't worked 

If(

       

        Title7 = Gal1.Selected.Title7,

        Filter(

            'MYSPLIST',

            City.Value = Gal1.Selected.Title7.Text

        ),

        Title5 = Gal2.Selected.Title5,

        Filter(

            'MYSPLIST',

            Country.Value = Gal2.Selected.Title5.Text

        ),

        Title2 = Gal3.Selected.Title2,

        Filter(

            'MYSPLIST',

            State.Value =Gal3.Selected.Title2.Text

        )

 

Categories:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Girishiam ,

     

    Your formula return the result of the first filter based on your selections on your three filtering galleries. I guess what you're looking for is filtering your main gallery using the three secondary galleries at the same time.

     

    If it is, then you need to actually reverse your "If()" and "Filter()" with something like this:

     

    Filter(MYSPLIST,
    If(Not(IsBlank(gal1.Selected.Title7.Text)), City.Value = gal1.Selected.Title7.Text, true),
    If(Not(IsBlank(gal2.Selected.Title5.Text)), Country.Value = gal2.Selected.Title5.Text, true),
    If(Not(IsBlank(gal3.Selected.Title2.Text)), State.Value = gal3.Selected.Title2.Text, true))

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Girishiam 

    You didn't mention if your results should be inclusive or exclusive, so, if inclusive, then consider the following to replace your formula:

    Filter('MYSPLIST',
     (Title7 = Gal1.Selected.Title7 && City.Value = Gal1.Selected.Title7.Text) ||
     (Title5 = Gal2.Selected.Title5 && Country.Value = Gal2.Selected.Title5.Text) ||
     (Title2 = Gal3.Selected.Title2 && State.Value = Gal3.Selected.Title2.Text)
    )

     

    I hope this is helpful for you.

  • Girishiam Profile Picture
    23 on at

    Hi Wizey,
    Thank you for sharing!!
    I tried the above condition, the gallery is not returning any record 

  • Girishiam Profile Picture
    23 on at

    Hi Randy,

    Thank you for sharing.
    Expecting the exclusive results

  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Girishiam ,

     

    Something confuses me... What are those "Titlex" and "Galx.Selected.Titlex" you're comparing here? If those are components, then you're doing it wrong as you should compare their properties and not the whole object itself.

     

    And if it's exclusive, then by reusing @RandyHayes 's formula it should be something like this:

     

    Filter('MYSPLIST',
     (Title7 = Gal1.Selected.Title7 && City.Value = Gal1.Selected.Title7.Text) &&
     (Title5 = Gal2.Selected.Title5 && Country.Value = Gal2.Selected.Title5.Text) &&
     (Title2 = Gal3.Selected.Title2 && State.Value = Gal3.Selected.Title2.Text)
    )

     

     

    But again, comparing "Title7" to "Gal1.Selected.Title7" for example seems wrong and may be the cause of the lack of result. If those are labels, can you try comparing their property "Text" instead?

  • Girishiam Profile Picture
    23 on at

    Tried with the result.value(Text property) also bt gallery is not returning any record.
    Also tried  @RandyHayes  solution Gallery is  Returning Inclusive. 

    Filter('MYSPLIST',
     (Title7 = Gal1.Selected.Title7 && City.Value = Gal1.Selected.Title7.Text) ||
     (Title5 = Gal2.Selected.Title5 && Country.Value = Gal2.Selected.Title5.Text) ||
     (Title2 = Gal3.Selected.Title2 && State.Value = Gal3.Selected.Title2.Text)
    )

    The gallery is not returning any record with this logic

    Filter('MYSPLIST',
     (Title7 = Gal1.Selected.Title7 && City.Value = Gal1.Selected.Title7.Text) &&
     (Title5 = Gal2.Selected.Title5 && Country.Value = Gal2.Selected.Title5.Text) &&
     (Title2 = Gal3.Selected.Title2 && State.Value = Gal3.Selected.Title2.Text)
    )
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Girishiam 

    The easiest way to work out your criteria is to know that ALL of your Boolean logic in the criteria will evaluate to either true or false.  If the result is true, then the record will be included in the results.  If the result is false, then it will be excluded.

     

    So, if you look at the formula for your criteria, it is VERY specific.  It states that EVERY condition in the formula MUST be true in order for the end result to be true, and thus include a record.

     

    Remember that T && T = T,    T && F = F,   F && T = F and    F && F = F

    And that T || T = T,     T || F = T,     F || T = T and    F || F = F

     

    So your formula currently would (because of all the &&'s) need to have every condition true.

     

    Not entirely sure what logic you want, but perhaps the above will give you some help.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard