Airtable linked record

I have checked the docs and I am wondering if I set linked column in airtable to lookup from another table what value I should set when I create new record? Record Id from lookup table?

Hi @Droren

Usually you will need to set the Id of a linked record. As this is the value that is actually used to setup the link.
Not sure on Airtable specifically, but it would surprise me if they made it differently.

1 Like

I’m facing this issue too. Usually, you’d just pass in record ID as an object, ie, [recordId], but with the Airtable nodes available in n8n (create and upsert), linked record fields are simply greyed out and non-edible. I can’t pass in a value or add an expression. Any workarounds other than a custom HTTPS post after the create/update step to populate the relationship?

1 Like

I am afraid not @alexiom, though this has come up a few times now and I hope we’ll change this soon.

For the time being I shall convert this into a feature request allowing you and other users to vote on having this implemented on the Airtable node.

For a workaround using the HTTP Request node head this way: Airtable multiple select field updated - ERROR: Invalid input for 'XXXXX' [item 0] - #13 by MutedJam

1 Like

PATCH call worked. Thanks!

Also, for a low(er) code fix, I found you can push the parent record ID’s into simple text fields, and then use an airtable automation running on record-create to resolve the lookup.

1 Like

I use another way:
copy node to vs,

there are “schema” item

this item look like:
{
“id”: “id”,
“displayName”: “id”,
“required”: false,
“defaultMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: true
}

so “readOnly”: true, I change to “readOnly”: false,

next ctrl+a, ctrl+c, and in n8n paste node,

remeber to change options to
“options”: {
“typecast”: true
}

11 Likes

This right here is the real MVP answer!

3 Likes

My friend!
What a life safer you have been!

3 Likes

Thank you! That was exactly what I needed too!

2 Likes

Wow - didn’t know you can work with nodes like this … thank you for this insight!

At first, I didn’t understand, but when I did… :fire: :fire: :fire: :fire:

Is it possible someone can show a video?

Hello,

I’m late to the party, but I would like to document my way here, as I have already realized it in make.com.
And now got it to work in n8n without any problems. :slight_smile:

Linking to another spreadsheet (lookup table) is not possible via the name of the entry (I think that should be clear).

I will explain this using my specific case:

  • Lookup Table: Courses
  • Main Table: Orders

Task: Add a new order with a linked course.

Step 1: Read out the record ID of the course

  • Node: Search Records
  • Filter: {product_code}="{{ $('product_code from input').item.json.product_code }}" (this is the course identifier, from a previous node)
  • Output fields: none (we only need the ID!)

Step2: Creating the order entry with linked record ID

  • Node: Create a Record
  • (fill in all regular fields)
  • :backhand_index_pointing_right: The field for the linked course: ["{{ $json.id }}"] (this is the record ID from Step 1)

Explanation: for a linked field, Airtable expects an array with one or more record IDs (strings).

That’s it! :wink:

Simon

You may use typecast feature.