Skip to main content

Hello,
I'm trying to run a script from BaseA to create a new record in BaseB. The new record in BaseB has a linked field, I followed this convention to reference it: Field_Name: [{id: record_id}]. I get INVALID_RECORD_ID error, though I've double-checked it and the record id is correct. What am I doing wrong?

 

let createRecordInBaseB = await fetch( `https://api.airtable.com/v0/${targetBaseId}/${targetTableId}`, { method: "POST", headers: { Authorization: `Bearer ${baseARecord.pat}`, "Content-Type": "application/json", }, body: JSON.stringify({ fields: { "👀 Projects": [{id: projectRecordId}], }, }), } );

 

  

When using the web API, the cell value for a linked record field is an array of record IDs, not an array of objects.

https://airtable.com/developers/web/api/field-model#foreignkey

 


Thanks for your answers, it works now