cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

Dynamic changes to gallery Items property - not working consistently

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,882)