cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Select Table for Gallery Dynamically

Hello All,

 

I've made an app where users can view documents that are in several libraries.

Upto now I've made it so that there are in fact 4 gallerys on top of eachother but with if/else logics I make sure only 1 is visible at a time.  (There is a dropdown menu to select which one you want to see).

 

Now I want to make this a bit more user friendly, when they create new libraries i'd like to support them too without having to change the code in the powerapp. So the names of the libraries are supplied to powerapps by a flow and put into the dropdown menu that determines which gallery is visible.  But how can I make 1 gallery show the library i selected in the dropdown?

 

redacted.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Select Table for Gallery Dynamically

Hi @gjeh ,

 

I'm afraid that what you want can't be achieved for now in PowerApps, it doesn't support reference the data source by variables as it can only be hardcoded in formula.

What we can do now is to display multiple Libraries in one Gallery by Switch function as follows.

Switch(Dropdown1.Selected.Value,"Library1",Library1,"Library2",Library2,"Library3",Library3)

However, it can not be done to display the new created library without changing any code, even though the library name can be passed to app by flow. For the moment, we need to hardcode each library name in Items property of Gallery.

If you want this function, please vote for this idea.

Sik

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Select Table for Gallery Dynamically

Hi @gjeh ,

 

I'm afraid that what you want can't be achieved for now in PowerApps, it doesn't support reference the data source by variables as it can only be hardcoded in formula.

What we can do now is to display multiple Libraries in one Gallery by Switch function as follows.

Switch(Dropdown1.Selected.Value,"Library1",Library1,"Library2",Library2,"Library3",Library3)

However, it can not be done to display the new created library without changing any code, even though the library name can be passed to app by flow. For the moment, we need to hardcode each library name in Items property of Gallery.

If you want this function, please vote for this idea.

Sik

View solution in original post

Highlighted
Helper V
Helper V

Re: Select Table for Gallery Dynamically

thank you for your clear answer, i voted on the feature.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,690)