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 a Gallery using...
Power Apps
Unanswered

Filter a Gallery using buttons

(0) ShareShare
ReportReport
Posted on by 11

Hi i have this gallery in my app browsegallery1 with this on Items = SortByColumns(Search([@POOL], TextSearchBox1.Text, "MATERIAL","NOMENCLATURA","NUMERO"), "MATERIAL", If(SortDescending1, Descending, Ascending))

 

In other Screen i have two buttons, i want to filter the gallery with the column "MATERIAL", i have two options there "CEMENT" and "pouzzolane"

 

i have this code in the buttons but it doesn't do anything

 UpdateContext({ds: Filter(POOL,MATERIAL="PUZO")});Navigate(BrowseGallery1,ScreenTransition.None)

 

thanks in advance

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Chris_Aguirre 

    UpdateContext() only works on the same screen.  You need to use a global variable if your variable is on another screen: Set(ds, Filter(POOL,MATERIAL="PUZO")) should do the trick.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Like Drrickryp said, updatecontext is a local variable compared to a global from Set(). If you are working with both, be sure to label the variables as such. I had a big issue with accidentally using a local variable that had the same name as a global variable. Or the other way around, I completely overhauled the code instead of trying to find where the wires got crossed. For globals I use either varTest or glblTest and for locals I use lclTest or locTest. Whatever you use, be consistent and do not change all willy nilly or it just creates more headaches.

  • Chris_Aguirre Profile Picture
    11 on at

    Thanks for the help, it didn't Filter the gallery 

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard