How to use data from one table in another table


Hi guys, I don’t really understand this, even though i’ve seen some tutorials about relations, my stupid mind can’t find a solution. I have multiple pages/databases across my app. I want to make a dashboard page in order to control everything from there. I want to use for this example all the data in the picture in the newly created dashboard in order to add some buttons and display some info, also to be able to delete that row in that database from the dashboard, not only to view the data. Can someone help me with this please?

kind regards

I think you could add a custom collection where the source of the custom collection is the table you are trying to initiate the action from. Then add a button.

thank you for your answer, doesn’t seems to work this way. i apreciate

Here’s a simple explanation using Glide tables:

In Glide, you can use data from one table in another table by using relation columns and lookup columns. Relation columns link rows between tables, and lookup columns allow you to pull in data from the related rows.

Example Tables

Table 1: Customers

Customer ID Customer Name Contact Info
1 John Doe john@example.com
2 Jane Smith jane@example.com

Table 2: Orders

Order ID Order Date Customer ID Order Amount
101 2024-05-10 1 $50.00
102 2024-05-11 2 $75.00

Steps to Link Tables in Glide

  1. Create the Primary Table (Customers):
  • Add a table named “Customers” with columns for Customer ID, Customer Name, and Contact Info.
  1. Create the Secondary Table (Orders):
  • Add a table named “Orders” with columns for Order ID, Order Date, Customer ID, and Order Amount.
  1. Add a Relation Column:
  • In the “Orders” table, add a new column and set the type to “Relation.”
  • Relate the “Customer ID” column in the “Orders” table to the “Customer ID” column in the “Customers” table.
  1. Add a Lookup Column:
  • In the “Orders” table, add a new column and set the type to “Lookup.”
  • Use the relation column created in the previous step to pull in the “Customer Name” from the “Customers” table.

Using Linked Data

  • When you add a new order in the “Orders” table, you can select the corresponding Customer ID.
  • The relation column will link the order to the customer, and the lookup column will pull in the customer name from the “Customers” table.

Example Usage

  • Orders Table with Lookup:
    • Order ID: 101
    • Order Date: 2024-05-10
    • Customer ID: 1 (Linked to John Doe in the Customers table)
    • Order Amount: $50.00
    • Customer Name: John Doe (Pulled in using the lookup column)

This way, you can easily use data from one table in another table in Glide, making it possible to reference and display related data across tables.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.