Linking records via Airtable API

I send a lot of data to airtable via the API. As part of this, I need to have the records linked for my softr site.

It it quite simple to do this and am sharing to help the community.

Here’s the example:

Table A: Neighborhood table
Table B: Home Table

I want “Home” rows inserted into table B to be linked to a Neighborhood in table A.

The field in Home is that is the linked field is called “linked neighborhood”.

Home A is in the Neighborhood "123 ", which in the neighborhood table has recordID recKegYpfsafsdJKtE.

When inserting the python data dictionary to airtable. The value of the linked field should have the recordID name in brackets like this: ['recKegYpltiJJKtEU].

Here is a screenshot (pretend task_provide is the linked field name I gave in the example) :


I should add, it needs to be a JSON list, not a string