Hi there, I’m kinda new to Glide since a few days, and in my app I want to use data from one table to another (like 2 separate tabs filled with data) to be able to reuse data according to a certain value in the first tab.
I don’t know if I am kinda clear, relations don’t work and I can’t find a way to separate every data, it’s either all or nothing.
Hello Arnaud, welcome to Glide’s community forum.
A few random ideas:
Are you sure you need to copy data from one table from another? If possible I would consider other options first.
Table architecture. Imagine I’m creating a Things tab on which I will display a collection of Things. In the Data Editor, I create a table called Things Tab and don’t touch it (I might touch it at the outset). I create a second table called Things Collection where I will store data related to the Things collection. Each of my tabs have their own table, each of my collections have their own table, and I keep these tables strictly separate.
One-off methods to copy data. You can right-click on any table and duplicate it. You can right-click on any table and do a data import. You can select cells in one table and copy-paste them into another. Below the Users table, you can import a file.
As long as the style of a tab is custom, any collection, and therefore any table, can live on any tab via a collection component.
Fetching data from another table. You can leverage the Single Value column. In the destination table (the table you are copying the data to):
- Create a dynamic RowIndex column: RowID column, lookup of RowID column, find element index of RowID column.
- Create a Single Value column to pull in a column from the origin table: Single Value column, from start, RowIndex, column from the original table.
- Repeat with Single Value columns to fetch additional columns.
I hope this helps.
Hi Nathanael, thanks for your answer !
I was looking up doing the 5th point, but I encounter a problem, as I need to get data from every row of column 1, and the single value just gets me the same value every time… And I need it to be dynamic, as the user could modify what’s on the 1st column rows when modifying a form.
The method I described is dynamic and should return every row in the column. Did you follow my configuration of the Single Value column exactly? (Single Value column, from start, RowIndex, column from the original table)
Thanks again, I can’t seem to find the RowIndex, where is it exactly ?
Or maybe I missed something to do when searching ahah
In point 5. Fetching data from another table, the first bullet point is “Create a dynamic RowIndex column”.
That I did right here I believe
But the thing is I’d like to have each value extracted automatically, not with a numbered row explictly filled in the column parameters (like if there’s 2 values like here, having 2 rows created with those 2 values put first)
There are often many ways to achieve the same result. The method I explained above Fetching data from another table is dynamic and uses a minimal amount of columns, but I’m sure there’s better. If you come up with a different or more efficient method, do please share.
Can you describe your 2 tables’ structure and your app flow?