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 with 6 filter ...
Power Apps
Unanswered

Gallery with 6 filter button updatecontext

(0) ShareShare
ReportReport
Posted on by 16

Hi Guys,

 

I am new to Powerapps and wanted to create a tool where I have 6 different buttons for each team based on the selection it will filter my gallery.

 

I have created for each button onselect:

UpdateContext({FilterATeam:!FilterATeam})

UpdateContext({FilterBTeam:!FilterBTeam})

UpdateContext({FilterCTeam:!FilterCTeam})

UpdateContext({FilterDTeam:!FilterDTeam})

etc

 

When It comes to write the formula in the gallery I tried something like Filter(MySP,If(FilterAteam=true,Title="Ateam",false)) but I don't know how could I add the rest of the updatecontext formulas in the gallery together.

 

Thank you for the help

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You can do a crazy nested If Function, but I think this is easier an cleaner. If you don't like it, I can help you write the nested If Funtion. I'm new at this too, so check my syntax! 

     

    Use ONE Context Variable - so for each button's onselect:

    Button for Team A: UpdateContext({cvarteamtofilter:TeamA})

    Button for Team B: UpdateContext({cvarteamtofilter:TeamB})

    Button for Team C: UpdateContext({cvarteamtofilter:TeamC})

    Button for Team 😧 UpdateContext({cvarteamtofilter:TeamD})

     

    Then on your Gallery Items

    Filter(Sparepointlistname,Spharepointlistcolumn,

    Switch(cvarteamtofilter

    TeamA, "Team A",

    TeamB, "Team B",

    TeamC, "Team C",

    TeamD, "Team D"

    ))

     

    This is saying filter this sharepoint list's column based on the value of the context variable. 

    Switch(contextvariablename,

    "variablevalue=this", "return this value into he Filter function",

    "variablevalue=that", "return this value into he Filter function",)

     

    You can add as many things to switch the output value as you have option 

    Again, I am new - so my question, or where I will have to play with it - I'm not sure if the context variable values have to be in quotes. 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Seriously, I am working through a similar scenario, so I as I do, I'm seeing other things that need to be set. 

    On the form's onvisable property, set the context variable to something else, maybe "AllTeams". and add this to your switch funtion inputs/outputs to filter by all too.  

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

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard