Help

Re: Appending to a linked record using scripting

1408 0
cancel
Showing results for 
Search instead for 
Did you mean: 
ChrisG
4 - Data Explorer
4 - Data Explorer

I am using an automation that uses a script to append a record to another table's linked field. My code is shown below.

ChrisG_0-1689790620784.png

This is not working however, as the record.getCellValue('Worksheet: BOM") is returning an array that has the format ("string") instead of the format (id: "String"). Is there any way to fix this?

This is my error message:

No overload matches this call.
The last overload gave the following error.
Property 'id' is missing in type 'readonly { id: string; name: string; }[]' but required in type '{ id: string; }'.(2769)
env.22.d.ts(5964, 43): 'id' is declared here.
env.22.d.ts(5959, 5): The last overload is declared here.
11 Replies 11
Sho
11 - Venus
11 - Venus

The object must be written according to the "Cell write format" on this page.
Cell values & field options - Airtable Scripting

Since the bomIDs are as formatted, you can be updated this way.

 

await table.updateRecordAsync(inputConfig.estRecordId[0],{
    'Worksheet: BOM' : bomIDs,
})

 

 

 

Hey Scott, I'm getting this to work on string fields, but not for linked records. Not sure why it's different, but it is  not working for linked records.