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 Visibility Issue
Power Apps
Answered

Gallery Visibility Issue

(0) ShareShare
ReportReport
Posted on by 104

I have multiple galleries on one screen. Depending on what the user clicked on the previous screen, that relevant gallery will be the only one visible. I tested this method out using these lines in the 'visible' property of each gallery:

 

(ListBox1.SelectedText.Value = "Table1")

(ListBox1.SelectedText.Value = "Table2")

(ListBox1.SelectedText.Value = "Table3")

etc.

 

This equates to 'true' and the gallery appears. I have to do this now for over 50 galleries so I was then thinking that in order to save repeating code, I could set a variable (tableName) to the ListBox1.SelectedText.Value and just have each visible property like this:

 

(ListBox1.SelectedText.Value = tableName)

 

Only problem now is all galleries are now visible. Is this a bug with PowerApps and variables as the var tableName is exactly the same as typing the listbox selected value as a string? Maybe variables don't work that way in PowerApps but if anyone has any ideas please share.

 

Thanks.

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ajennings1 

    Your issue is (from what I see) that you are setting the tableName to the ListBox1.SelectedText.Value, and then, you are using the formula for the visible property to compare if the selectedtext in listbox1 is equal to the tableName variable.  Well...it will be, because you set it to be that.  So, all of your formulas will evaluate to 'true'.

     

    I believe what you want in your visible formulas is:

       (tableName = "Table1")  etc.

     

    Also, you might want to consider changing the usage of SelectedText to Selected as SelectedText has been deprecated.

     

    I hope this is helpful for you.

  • LRVinNC Profile Picture
    2,297 on at

    Correct me if I am wrong, but what I understood you to say is that you are setting tableName = List1.Selected.Text.Value, then you are testing in your visible property for List1.Selected.Text.Value= tableName.  If that that is true, you have created a situation which will always evaluate to true because you just set one to the other and then tested the same exact condition you just forced to be equal - hence all your galleries will always display.

     

    I don't see an easy way around making an explict test for each gallery, but perhaps someone else can come up with one.  I have done similar when creating dialog boxes within a screen and I have always had to make an explict test.  (Of course, I had not layered 50 of them so it wasn't nearly as onerous, although I did have to check a lot of individual controls in my case)

  • ajennings1 Profile Picture
    104 on at

    @LRVinNC @RandyHayes,

     

    Ok I understand now whoops! There must be another way surely but I'll need to investigate further. It would be great to find a way where i could just CTRL+V into each visible property Smiley Very Happy

     

    Thanks.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ajennings1 

    Not easily in this case because your Visible property will be unique in each control.

    BUT...if you DO have a need to change the property of many controls at once, you can select the ones you want and then go to the property and change it.  It will change them in all the controls you have selected.

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard