✚ How to display data from a tab to another one?
Good news: you can do it — in just a few minutes!
Airtable doesn’t automatically “sync” values across tables, but it gives us powerful tools to make that happen: Linked Records, Lookup fields, and (for more control) Scripts.
Why link tables?
By linking tables in Airtable, you can:
- Pull data from one table to another (like a VLOOKUP in Excel)
- Display metadata or extra attributes without duplicating information
- Keep your database tidy, scalable, and user-friendly
Example: Show Products Metafields in the Products table
Let’s say you store additional information (like composition, technology, or product concerns) in a table called Products Metafields
, and you want that data to show up inside your Products
table.
Here’s how to do it:
1. Add a Linked Record field
In your Products table:
- Click the "+" to add a new column
- Choose “Linked record” as the field type
- Select the target table:
Products Metafields
- Name the column (e.g.
Products Metafields
)
This creates a relationship between each product and its metafields.
2. Use a script to automatically connect matching records
By default, Airtable doesn’t know which Products Metafields
row matches each product. To make that connection based on a common identifier — like Product ID
— we’ll use a script.
📋 What it does:
- Looks for rows in both tables where
Product ID
matches. - Links the matching
Products Metafields
record into theProducts
table.
📦 Copy-paste this into the Scripting extension
let productsTable = base.getTable("Products");
let metafieldsTable = base.getTable("Products Metafields");
let products = await productsTable.selectRecordsAsync();
let metafields = await metafieldsTable.selectRecordsAsync();
// Create a map: Product ID → record.id from Products Metafields
let metafieldsByProductId = {};
for (let record of metafields.records) {
let productId = record.getCellValue("Product ID");
if (productId) {
metafieldsByProductId[productId] = record.id;
}
}
let updates = [];
let log = [];
for (let record of products.records) {
let productId = record.getCellValue("Product ID");
if (!productId) continue;
let linkedMetafieldId = metafieldsByProductId[productId];
if (linkedMetafieldId) {
updates.push({
id: record.id,
fields: {
"Products Metafields": [{ id: linkedMetafieldId }]
}
});
log.push(`✅ Linked Product ID ${productId}`);
} else {
log.push(`⚠️ No match for Product ID ${productId}`);
}
}
// Batch updates (max 50 per request)
while (updates.length > 0) {
await productsTable.updateRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}
// Output results
output.markdown("### Script results:");
for (let entry of log) {
output.markdown(`- ${entry}`);
}
3. How to add and run the script
- In Airtable, open your base
- Click on the “Extensions” button (top right)
- Click “Add an extension” → choose “Scripting”
- Paste the script above
- Click “Run”
- Done! Your linked records are now connected 🔗
🎉 You're done!
Your Products
table now shows data from Products Metafields
, automatically linked by Product ID
. No manual copy-paste needed — just clean, connected Airtable magic.
Updated on: 23/07/2025
Thank you!