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

Referencing a Table with a Text value

Hi,

I have a table that I imported from excel, call it Table1. Table1 contains the names of other tables, also imported from excel.

 

On Screen1, I have Gallery1 displaying the data from Table1. 

 

On Screen2, I want to have Gallery2 displaying the data from the table whose name was selected from Gallery1.

 

What I have so far:

Gallery1 "Items" value: Table1

Gallery1 "OnSelected" value: Navigate(Screen2, ScreenTransition.Fade)

 

Gallery2 "Items" value: Gallery1.Selected.Column1

This throws an error because Gallery1's "Items" value expects a Table and not a Text value.

 

How do I reference the Table associated with the text value returned by Gallery1?

 

Thanks,

Jake

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

You cannot reference objects in PowerApps like that.

 

You will need to have a common data structure/signature for your Gallery2.

Or, you will need to make a Gallery for each table you have and set its Visible property based on the selection in Gallery1

 

If you are expecting to dynamically add table names to the first Gallery datasource and have PowerApps be able to display new ones without altering your App, you will not be able to do so.

 

Sorry of this is bad news, but hopefully it will give you some direction.

 

There are several ideas listed in the Idea Forum, including one I placed over a year ago) that you are welcome to go and vote on for this ability.

 

_____________________________________________________________________________________
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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
eka24
Super User
Super User

I assume the both Table1 and Table2 have a common Column
On the OnSelect of the Icon inside the Gallery1 put:

Navigate(Screen2);Set(varSelected, ThisItem.CommonColumn)

 

Then Filter Gallery2 as:

Filter(Table2, varSelected in CommonColumn)

Or

Filter(Tabel2,CommonColumn = varSelected )

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Hi,

 

The tables don't have common columns. Table1 holds the names of the other tables that I want to reference.

 

So, I want Gallery2 to fill its "Items" value with the table whose name was selected in Gallery1.

The problem is, the Gallery "Items" value only takes a Table data type, so simply passing the Text value of the name of the table that I want to reference throws an error.

 

Can I reference a Table with a Text value corresponding to its name?

@Anonymous 

You cannot reference objects in PowerApps like that.

 

You will need to have a common data structure/signature for your Gallery2.

Or, you will need to make a Gallery for each table you have and set its Visible property based on the selection in Gallery1

 

If you are expecting to dynamically add table names to the first Gallery datasource and have PowerApps be able to display new ones without altering your App, you will not be able to do so.

 

Sorry of this is bad news, but hopefully it will give you some direction.

 

There are several ideas listed in the Idea Forum, including one I placed over a year ago) that you are welcome to go and vote on for this ability.

 

_____________________________________________________________________________________
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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (941)