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 / Dynamic changes to gal...
Power Apps
Answered

Dynamic changes to gallery Items property - not working consistently

(0) ShareShare
ReportReport
Posted on by 471

I have a gallery which is set to filter items from a SharePoint list based on a column which will contain a text value of either "a" or "b". The filter points to a global variable, with expectation that by changing the global variable from a to b, my gallery should then switch to showing all the entries where the filtered column = b.

 

And that happens... most of the time.

 

The setup is across 2 pages. One the first are two buttons, one setting the variable to a then turning to the gallery page, and the other setting b.

 

If I press the a button, the page turns and the filter is correctly appliedthe first time only.

 

If I go back and select the b button, it still shows a in the gallery. If I then go back and press the same b button again, so basically pressing the same button a second time, the filter is now correctly applied.

 

Same the other way around too, so basically I think the behavior I'm seeing is that with my gallery set to filter on the value of a global variable, I have to set that global variable twice (to the same value) before the gallery will update the filter.

 

I tried in classic and improved rendering just in case - both the same.

 

For now I've worked around it by having two copies of the gallery, each permanently set to either a or b, and instead of changing the filter I just hide or show one or the other. So my new app can go live! But would be good to understand what's happening.

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @davidstone,

    Could you please share more details about your Filter formula typed within the Items property of the Gallery control?

    I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:9.JPG

     

    10.JPG

    Set the OnSelect property of the "Set A" button to following:

    Set(CurrentVariable,"a");Navigate(Screen2,ScreenTransition.Cover)

    Set the OnSelect proeprty of the "Set B" button to following:

    Set(CurrentVariable,"b");Navigate(Screen2,ScreenTransition.Cover)

    Set the Items property of the Gallery control to following:

    Filter('20181108_case9', CurrentVariable in TaskName) /* <-- TaskName is a column in my SP list */

    Please take a try to re-create your app, then check if the issue is solved.

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Agh, finally I found someone with the same problem as me but there's no solution!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard