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 gallery b...
Power Apps
Unanswered

Can't filter gallery by variable

(0) ShareShare
ReportReport
Posted on by 3

Hi there! - I am trying to filter a gallery by a variable that has been passed over to the screen where the gallery sits. 

DemandFamily is the variable and does have a value when trying to filter.

Navigate('Filter Down Screen', ScreenTransition.UnCoverRight, {DemandFamily: ThisItem.'Family Name'} < This is how the variable gets its value

Filter(
  SKUs,
    'Demand Family'.'Family Name' = 'Demand Family Dropdown_2'.Selected.Result

) << Works

Filter(
  SKUs,
    'Demand Family'.'Family Name' = DemandFamily
) << Brakes the gallery

Any ideas?

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    What formula are you using for the variable.

    Try:

     

    Filter(
      SKUs, DemandFamily in
        'Demand Family'.'Family Name'

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • bennking Profile Picture
    3 on at

    I have added the formula on how the variable is populated with a value.

     

    DemandFamily in 'Demand Family'.'Family Name' produces the same result and just brakes the gallery (there are no syntax errors). 

  • eka24 Profile Picture
    20,925 on at

    I assume the variable is inside a Gallery. If so change it to

    Navigate('Filter Down Screen', ScreenTransition.UnCoverRight);

    Set(DemandFamily, ThisItem.'Family Name')

     

    Filter:

    Filter(SKUs, DemandFamily in 'Demand Family'.'Family Name')

    Or

    Filter(SKUs,'Demand Family'.'Family Name' = DemandFamily)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • eka24 Profile Picture
    20,925 on at

    Please is this issue resolved

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    How does it break your gallery?  What is happening?  

     

    Also have you put a label on your screen and populated it with the variable to make sure the value is what you think it is?

  • BennDev Profile Picture
    13 on at

    Both of these don't work! So weird 😕

  • BennDev Profile Picture
    13 on at

    By brake, I mean no results appear in the gallery.

    'Demand Family'.'Family Name' = 'Demand Family Dropdown_2'.Selected.Result  << This works, but when I change the filter to ue the variable that has the excact same value as 'Demand Family Dropdown_2'.Selected.Result it doesen't work 😞 

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Do you get any syntax errors or red squiggly lines?    If so what is the error message?

     

    Did you verify the content of the variable by displaying it as a label?   Whenever I run into an issue like this I always verify the variable by using it in a label.   Many times there is something with the value of the variable that shows up when displayed in a label.

  • BennDev Profile Picture
    13 on at

    No syntax errors or squiggly lines! I have written lots of code in this Power App but this bug has stumped me. 

    Making the variable a label does indeed show the value as expected. Weird 😞 

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Have you tried switching this around?

     

    Filter(
    SKUs,
    'Demand Family'.'Family Name' = DemandFamily
    )

     

    Filter(

    SKUs,

    DemandFamily in 'Demand Family'.'Family Name'

    )

     

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard