Create table record via API that includes a record link

I have two tables that are joined via a Linked Record field (Table A → Table B in a 1:1 relationship). Through REST, I would like to create a new record in Table A that include the reference to an existing record in Table B. I’ve tried something like this {“EfuYKrneFcwKzcuqG_link_left_column”: “001”} in the body of the REST call which are the field ID and the record ID respectively. But I get an internal server error. What is the correct way to create the relationship via the REST API?

hello @Lance, welcome to the Tulip Community!! it would be great if you can introduce yourself here: Welcome to the Community, let's meet!.

the only thing you need to add to the request are square brackets around the ID of the linked field. even if it’s a 1:1 relationship in the linked field, the API endpoint is expecting an array. something like this should work:

{
"ID": {{Record ID}},
"EfuYKrneFcwKzcuqG_link_left_column": ["001"]
}

here’s an example:


let me know if this helps and if you have further questions!! thanks for posting.

1 Like

Outstanding. Thanks for the quick response. I actually stumbled upon this just before seeing the email and was going to go update the post. Much appreciated!

~WRD0001.jpg

great to hear @Lance!!

it would be interesting to see how you’re using the Table API, feel free to post in Show and tell - Tulip Community if you’d like!!

1 Like