cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

data source selection

Hello, 

i have 10 tables excel which name re table1, table2,..., tables 10 as datasources of my Browsegallery

i created a textbox. I want to use this textbox to call out my gallery datasource, is it possible?

exemple in textbox i write: table1

my browsegallery.item: SortByColumns(textbox.text, price, ascending)

Do we have any solution to make the value of textbox.text become a name of datasources?

My app has so many sources to work with, so i just want to call out the datasource i want to use for this moment.   

Thank you for help

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Anonymous 

By-Reference of variables, controls and more is not available yet in PowerApps.  There are some ideas in the Ideas list for that...feel free to search and vote.

 

In the meantime, you would add each table as a DataSource in your App and then you could use conditional formulas to determine what you want to get data from.

However, also be aware that you will run into problems if you have tables with completely different columns in them as your Galleries will not be able to resolve the data signatures.

 

Even though it may sound painful...it's not really - so consider this, you could easily create 10 galleries all tied to the appropriate datasources.  Then from your text box (although I would suggest a DropDown of some sort) you can trigger off of it to make galleries visible or not.

Example, Gallery1 is using data source Table1.  Set the Visible property to : (textBox.Text="Table1")

This would return true only if Table1 was typed into the text box and thus Gallery1 would become visible.  If you have the same type of formulas on all the other Gallery visible properties, they would be false in this situation (Gallery2 visible : (textBox.Text="Table2") would be false - not visible). 

So, no, no way to make one gallery and swap the datasource from a text field, but you can get close to it with this solution.

 

I hope this helps you a bit.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

1 REPLY 1
RandyHayes
Super User III
Super User III

@Anonymous 

By-Reference of variables, controls and more is not available yet in PowerApps.  There are some ideas in the Ideas list for that...feel free to search and vote.

 

In the meantime, you would add each table as a DataSource in your App and then you could use conditional formulas to determine what you want to get data from.

However, also be aware that you will run into problems if you have tables with completely different columns in them as your Galleries will not be able to resolve the data signatures.

 

Even though it may sound painful...it's not really - so consider this, you could easily create 10 galleries all tied to the appropriate datasources.  Then from your text box (although I would suggest a DropDown of some sort) you can trigger off of it to make galleries visible or not.

Example, Gallery1 is using data source Table1.  Set the Visible property to : (textBox.Text="Table1")

This would return true only if Table1 was typed into the text box and thus Gallery1 would become visible.  If you have the same type of formulas on all the other Gallery visible properties, they would be false in this situation (Gallery2 visible : (textBox.Text="Table2") would be false - not visible). 

So, no, no way to make one gallery and swap the datasource from a text field, but you can get close to it with this solution.

 

I hope this helps you a bit.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (47,149)