How can I choose data source for detail page depending on user choice?

Hi all,
I have a table called LocationList and a separate table for the data of each location. For example my locationList might have Texas, and Florida. Then I have two tables, one table with the data. for texas, and another with the data for florida. How can I automatically set the source of the detail page depending on what the user clicks in the location list. I am trying to avoid duplicating the view and making a separate view for each location. Is there something I could do maybe to relate a data table to specific rows in my locationlist table?

If you put all of your state data in one table, then you won’t have to duplicate any of the views. Create a relation linking the LocationList State to the State in the State table. Then, assuming your are trying to display a collection of state related data, you can set the source of the collection to use the relation.

I cannot combine it all into one table (at least manually… if I can do that in an automatic way that would work). Would those instruction works without combining everything into one table beforehand?

Everything including design is inherently linked to the underlying table. If you continue to use separate tables then you will have to redesign everything for each and every table, and all further maintenance would have to be duplicated as well.

Why can you not combine the data? How do you obtain the data in the first place? What is the data source of those tables?

They are tables in google sheets. I was assigned to do this without combining all the tables so if I need to ill have to make separate views for each table. I know with SQL I can make a relation table for that purpose but I guess that isn’t the case with glide.

Follow up question…would users of the app be able to edit any of those rows, or is it just static data for viewing only?

Viewing only

In that case, my suggestion would be to create a new tab in the google sheet with a formula like this to combine everything into one table.

=QUERY({Sheet1!A1:B10; Sheet2!A1:B10}, "SELECT * WHERE Col1 IS NOT NULL", 0)

Then only use that new table in your app.

2 Likes