How to make use of the link function of airtable?

Hello.

If I want to get the name of the CREATOR as shown in the image, what configuration should I use?


Hello!

First, as the creator is a link to another record in your Airtable collection, you’ll need to make sure you’ve set a lookup depth of 1

Then, you should be able to find the creator name in the quick access drop down.

Here’s a similar example where we bound a collection of real estate listings and go get the name of the agent related to that listing in a different table:

Does that help?

Thank you!
This worked flawlessly!

But what do you mean by lookup depth?
I would appreciate it if you could give me some details.

Hi @hiroto
In Airtable you can have a link between two tables. For that, Airtable put an id on the column (this is what you saw on your first post: only the ID).
When you configure your collection in WeWeb, you can ask to fetch related data: WeWeb will see an ID on the creater column, and will ask Airtable for the corresponding data in the other tables.
Because this feature can exponentially add data on your collection, by default we don’t do that (Lookup depth = 0).
When you set Lookup Depth to 1, we fetch all the associated data.
If you set Lookup Depth to 2, we will do the same for the data fetch the first time.

So for example, if your item has a creator column which is link to a User database, and then each User is linked to Project (an other table):

  • Look up depth = 0 will only fetch your items data, and creator will just be an id
  • Look up depth = 1 will fetch your items, and for each item all the information of the creator, but not the information about the creator project
  • Lookup depth = 2 will fetch your items, their creators, and also for each creator of each item the data of the project

As you can see, this is a powerfull tool, but do not set it higher than needed, because your data can then be too big to be fetch :slight_smile:

1 Like

Sure!

So when you’re working with an SQL database – which Airtable essentially is – you often have several tables.

For example, in my real estate listings example, I have:

  • a table with a list of available properties
  • a table with a list of real estate agents

The power of SQL databases comes in the fact that you can establish relationships between items that are in different tables.

In our real estate example, you can link a real estate agent to several real estate listings. In Airtable, you do this with a “Link to another record” field type.

In this screenshot, you can see that I am in the “Listings” table of my SQL database with a field that relates to the “Agents” table.

Now in the “Agents” table, I’ve added a “Link to another record” in a third table called “Real Estate Agencies.”

In WeWeb, if you add the “Listings” table with the default depth of 0, we will be able to fetch all the data that is in the “Listings” table but not the data that relates to the “Agents” table.

If you add the “Listings” table with a depth level of 1, we will be able to fetch all the data that is in the “Listings” table and go 1 step further in the data set, finding the data that relates to the “Agents” table.

If you add the “Listings” table with a depth level of 2, we will be able to fetch all the data that is in the “Listings” table and go 2 steps further in the data set, finding the data that relates to the “Agents” table and the data that relates to the “Real Estate Listings” table.

Does that help?

1 Like

Damm, Joyce is so much better than me to explain :star_struck:

I see!
Your explanation made sense to me!

Thank you very much!

1 Like

** UPDATE **

You can no longer add a lookup depth to an Airtable Collection in WeWeb.

Wait wait wait, it’s a good thing! Promise :hugs:

Before

  • Users added an Airtable Collection with lookup depth,
  • They reached their data limit real fast, and
  • Loaded tons of unnecessary data on pages that didn’t necessarily need it.

The result: heavy pages that performed poorly.

Now

  • Users add one Airtable Collection for each table in their base,
  • They understand exactly which tables are taking up space,
  • Depending on the data they need on a page, they only load that information,
  • If they need to link two tables, they use the lookup, lookupArray, or rollup formulas to get the information they need from another Collection.

The result: lighter pages that perform much better with only the relevant data loaded onto the page :rocket: