[SOLVED] POST and PATCH error: linked columns with multiple values


#1

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?


#2

I’m pretty sure you have to put 'm in an array (put brackets around it). :slight_smile:

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.


#3

Oh, and not sure about typecast. It might work here…


#4

@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"
	}
}

#5

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 .