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 Galery based on...
Power Apps
Answered

Filter Galery based on button selection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there, 

 

I am fairly new to PowerApps and have a question regarding filtering a gallery on screen 2, based on the selection of a button on screen 1.  let me elaborate on both screens. 

 

Screen1 is a graphical roadmap showing four phases (like a flow diagram) with buttons assigned to the areas of the phase. 

- Button 1 = Phase 1
- Buttone 2 = Phase 2

- Etc. 

 

Each of the buttons Navigate to the same screen 2 with Navigate(Deliver,ScreenTransition.Fade). 

Now I would like to filter the Gallery on screen 2, based on the button that was chosen to (e.g. button phase 2 was chosen, I would like the Gallery on screen 2 to be filtered by the phase that was selected to get to screen 2. 

 

Could you please be of assistance?

 

Thanks!


Maurice

Categories:
  • Verified answer
    wyotim Profile Picture
    2,545 on at

    Hey Maurice, it sounds like you need to pass a variable from screen 1 to screen 2 and then set up your filter on screen 2 depending on what is passed (or not passed). 

     

    To pass a variable, you can edit your Navigate code to something like this:

     

    // Pass Phase 2 selection to screen 2
    Navigate(Deliver,ScreenTransition.Fade, {Phase: 2})

    You would then need to set a filter based on the variable, which depending on how your data is set up in the Gallery could be easy or a bit tricky. In fact, I would actually start with that part: what in the Gallery's data relates to the selection you are making and then structure the variable you pass based on that.

     

    I'd be happy to go more in-depth if needed but hopefully that gets things moving in the right direction!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi wyotim,

     

    Thank you for the quick reply and help already!

    Let me provide some more detailled expalantion.

     

    Screen 1: overview of innovation Phases.

    - Phase: Discover

    - Phase: Develop

    - Phase: Deliver & Test
    - Phase: Scale 

     

    Each of these phases on Screen 1 has a button next to it (i.e. DiscoverButton, DevelopButton, etc.).

    By clicking the button the user should be able to navigate to Screen number 2, passing a value from the button to be used as a filter on the Gallery of screen 2. i.e. clicking DiscoverButton, navigate to Screen 2 & pass value Phase=Discover.

     

    Screen 2 has a gallery with as a data source a list on Sharepoint, see capture below.

    Now, by clicking the DiscoverButton I would like the Gallery to be filtered based on the Phase value of DiscoverButton: filtering the galery for Phase=Discover.

     

    I have now set up the button of Phase:Delivery on Screen1 as follows:

     

    Navigate(['Service Offering Overview'],ScreenTransition.Fade, {Phase: Delivery})

    Though, I am getting an error message: "Incompatible type. We can't evaluate your formula becuase the context variable types are incompatible with the types of values in other places in your app".

     

    Hope this makes my ambitions a bit clearer. 

     

    Thank you for your help. 

     

    Capture.PNG
  • wyotim Profile Picture
    2,545 on at

    Try this:

     

    Navigate('Service Offering Overview', ScreenTransition.Fade, {Phase: "Delivery"})

    I copied your code but I removed the square brackets from the screen name as I believe those denote a list in PowerApps and I added double quotes around Delivery as it appears to be a text field in your screenshot. I think that is where the incompatible type error is coming from. Let me know if that doesn't work and we'll give it another go!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've now tried to make another column in my list called InnoPhase with integers associated to the Phase that was a string. (i.e. Phase= Discover; InnoPhase =1). 

     

    I now made a dummy button with your code, slightly altered to the dummy button:

     

    Navigate('Service Offering Overview',ScreenTransition.Fade, {InnoPhase:1})

    This works!!

    Don't know why the string pass does't seem to work, though. 

     

    Now on screen 2 I have used thefollowing filter to streamline the Gallery based on the Phase. 

     

    Filter('Orchestrated Innovation Database', 'Orchestrated Innovation Database'.Phase = InnoPhase)

    Giving me an error "Delegation warning. This part "Filter" of this formula might not work correctly on large data sets. "The datasource might not be able to process the formula and might return incomplete dataset.".

     

     

     

  • wyotim Profile Picture
    2,545 on at

    For the delegation error, try this:

     

    Filter('Orchestrated Innovation Database', Phase = InnoPhase)

     

    You don't need to reference the table again (e.g. 'Orchestrated Innovation Database'.Phase) as it is implied from the previous reference in the Filter statement. I would think that is where the delegation warning is coming in but it could be something else. Maybe try that though and let me know if it doesn't do the trick.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes! that worked  🙂 

     

    Thank you for your help. 

  • wyotim Profile Picture
    2,545 on at

    Glad to be able to help! Smiley Very Happy

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 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard