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 / Gallery Filter Syntax
Power Apps
Answered

Gallery Filter Syntax

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

I have an If statment filtering a gallery.   The items displayed in the gallery are based on the values in 2 dropdowns and works nicely.

 

If(
 !IsBlank(DropdownRegion2), Sort(Filter(Holidays, CountryNoRegion = DropdownCountry2.Selected.Result && Region = DropdownRegion2.Selected.Result), Date, Ascending),
 Sort(Filter(Holidays, CountryNoRegion = DropdownCountry2.Selected.Result), Date, Ascending)
)

 

I need to add a new condition.  If the condition is met I want the gallery to not display anything at all.   But I don't know how to do the last part of the syntax.  I need to add this as the first condition of the If statement.   I have validated that the first part works.

 

If(
 CountRows(Distinct(Filter(Holidays, CountryNoRegion = DropdownCountry2.Selected.Result && !(Region = CountryNoRegion)), Region)) >0 && IsBlank(DropdownRegion), Not sure what to put here for displaying nothing

)

 

Categories:
I have the same question (0)
  • Verified answer
    zmorek Profile Picture
    3,272 on at

    Can you put that on the Visible property of the gallery?

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

    I made the age old error of assuming that the dropdown would be blank if nothing was selected and I was wrong. 

     

    I did take your suggestion, but I modified the formula.   I set a context variable on select of the region and set it back to false on select of a different country.  So my visible formula is this:

     

    If(CountRows(Distinct(Filter(Holidays, CountryNoRegion = DropdownCountry2.Selected.Result && !(Region = CountryNoRegion)), Region)) >0 && !ShowGallery,false, true) 
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Is it possible if the column condition is a variable?

    Example below:
    Filter(EXTRA_EMP_FIELD, LookupExtra = LookUpValue)

    where EXTRA_EMP_FIELD is the source
    and LookUpExtra & LookUpValue are variables

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard