Aug 19, 2016 04:17 PM
Is there a way to create a new record and enter a RECORD ID inside of a linked column? I’d like to reference the ID of other tables in my new entry, but am getting this error:
According to AirTable’s documentation: “Airtable API performs automatic data conversion from string values if typecast parameter is passed in. Automatic conversion is disabled by default to ensure data integrity, but it may be helpful for integrating with 3rd party data sources.” Will enabling this feature solve the problem?
Aug 19, 2016 11:26 PM
I’m pretty sure you have to put 'm in an array (put brackets around it). :slightly_smiling_face:
If you open the API and have a look at the table with a record in it, what does it look like?
Best, Arthur.
PS: not sure what the error is trying to tell us here though.
Aug 19, 2016 11:49 PM
Oh, and not sure about typecast. It might work here…
Aug 20, 2016 08:57 AM
@Tuur is correct.
For the most part, ANY field that CAN contain multiple values will return an array and require an array to POST/PATCH a record.
So when creating or updating a Multiple Select, Link to Another Record, or Attachment field you must send an array. This can be counter intuitive because even when you’ve unchecked, “Allow Linking to Multiple Records”, you must still pass an array to create or update a Linked field.
{
"fields": {
"upcoming_event": ["xxxxxxx"],
"person": ["xxxxxxx"],
"status": "not contacted"
}
}
Aug 20, 2016 12:18 PM
You guys hit the nail on the head, it was the formatting of the array as @Chester_McLaughlin 's code above shows. I would like to read up more on use-case examples that do use typecast. Thanks for all the help @Tuur and @Chester_McLaughlin .
Jun 11, 2021 12:21 PM
You just need to call the id that airtable api generates. If you do this air table will select the corresponding field but through the api you must allways use the api’s ids.