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 Items
Power Apps
Answered

Filter Gallery Items

(0) ShareShare
ReportReport
Posted on by 232

Hello,

 

I am unsure if this can be done but I have a Gallery I am using for a menu in my app. The item's property is my collection. My collection is:

ClearCollect(
 colMenu,
 {
 MenuID: 1,
 MenuName: "Home Screen",
 MenuIcon: Icon,
 ScreenToGoTo: HomeScreen
 },
 {
 MenuID: 2,
 MenuName: "Screen2",
 MenuIcon: Icon,
 ScreenToGoTo: Screen2
 },
 {
 MenuID: 3,
 MenuName: "Screen3",
 MenuIcon: Icon,
 ScreenToGoTo: Screen3
 },
 {
 MenuID: 4,
 MenuName: "Screen4",
 MenuIcon: Icon,
 ScreenToGoTo: Screen4
 },
 {
 MenuID: 5,
 MenuName: "Screen5",
 MenuIcon: Icon,
 ScreenToGoTo: Screen5
 },
 {
 MenuID: 6,
 MenuName: "Screen6",
 MenuIcon: Icon,
 ScreenToGoTo: Screen6
 }
);

 

I want to make MenuID 2 visible only during September, January, and May. I also need to have MenuID 6 only visible to my "Admin" UserRole that I have set in my SharePoint. So far I can get one of these to work but not both. I have used these formulas separately in the Gallery Items Property:

Filter(
 colMenu,If(
 LookUp(
 UserRoles,
 UserEmailAddress = User().Email
 ).UserRole = "Admin",
 true,
 false
 ) || MenuID <> 6
)

Filter(
 colMenu,
 If(
 Month(Today()) = 9 || Month(Today()) = 1 || Month(Today()) = 5,
 true,
 false
 ) || MenuID <> 2
)

 

Is there a way to do both of these in a Gallery?

 

Thanks for any help with this.

 

Collin

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Hi @collinktx ,

    Try this format

    ClearCollect(
     colMenu,
     {
     MenuID: 1,
     MenuName: "Home Screen",
     MenuIcon: Icon,
     ScreenToGoTo: HomeScreen
     },
     If(
     Month(Today()) = 9 || Month(Today()) = 1 || Month(Today()) = 5,
     {
     MenuID: 2,
     MenuName: "Screen2",
     MenuIcon: Icon,
     ScreenToGoTo: Screen2
     }
     ),
     {
     MenuID: 3,
     MenuName: "Screen3",
     MenuIcon: Icon,
     ScreenToGoTo: Screen3
     },
     {
     MenuID: 4,
     MenuName: "Screen4",
     MenuIcon: Icon,
     ScreenToGoTo: Screen4
     },
     {
     MenuID: 5,
     MenuName: "Screen5",
     MenuIcon: Icon,
     ScreenToGoTo: Screen5
     },
     If(
     LookUp(
     UserRoles,
     UserEmailAddress = User().Email
     ).UserRole = "Admin",
     {
     MenuID: 6,
     MenuName: "Screen6",
     MenuIcon: Icon,
     ScreenToGoTo: Screen6
     }
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • collinktx Profile Picture
    232 on at

    Awesome! This works like a charm. Thanks!

     

    Collin

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

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard