I,
I would really appreciate if anyone could help me please. I’m building a driver matching workflow and I’m stuck on a data scoping issue inside a loop.
The Goal:
Inside a Loop Over Items node that processes a list of drivers, I need to use the Airtable - Create Record node to create an entry in an “Interest Log” table. This new log entry needs to link to two different records :
- The Booking Request (data from a node before the loop started).
- The Current Driver (data from the current iteration of the loop).
The Problem:
My Airtable - Create Record node is failing to create the two separate links correctly. When the record is created in Airtable, both the Linked Request ID and Linked Driver ID fields end up pointing to the same incorrect Record ID (the ID of the new Interest Log entry itself).
My Setup:
- Before the loop, a Set node creates a combined data object for each driver: { “driverRecord”: {…}, “requestRecord”: {…} }.
- The Loop Over Items iterates through this.
- Inside the loop, the Airtable - Create Record node uses these expressions for the linked fields:
- Linked Request ID: [ “{{$json.requestRecord.id}}” ]
- Linked Driver ID: [ “{{$json.driverRecord.id}}” ]
Even though the expressions {{$json.requestRecord.id}} and {{$json.driverRecord.id}} show the correct, distinct IDs in the n8n editor’s preview, the links created in Airtable are wrong.
My Question:
What is the most reliable n8n pattern or expression syntax to use inside a loop to correctly populate two different “Link to another record” fields in an Airtable Create Record operation, where one ID comes from the loop’s current item and the other ID comes from data that was passed into the loop?
Would anyone have any clue on what I should do?
Rgds,
Greebo