Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Feb 03, 2023 09:13 AM - edited Feb 03, 2023 09:20 AM
I have a use case where I am entering data from an outside source. These records will later change on this outside source and I would like to be able to update the AirTable record based on these changes.
The problem that I am running into is that you seem to need the AirTable record ID to do this - which I won't have. I am wondering if it is possible to do any of the following:
I know that the create query returns the recId and I could potentially update my original database with this ID and use it, but I would like to avoid this if possible. It is confusing to me that the docs have an "upsert" option listed, but there doesn't seem a way to actually do this as we can't enter our own id.
There is this option:
https://community.airtable.com/t5/development-apis/new-beta-rest-api-upserts/td-p/51628
It looks like I can use an ID from my own table and then use the "performUpsert": {
"fieldsToMergeOn": ... to update the record I want based on that. The problem is that I am using the Airport package from npm and there is no explanation as to how to use this tool instead of curl to do this.
Feb 04, 2023 07:10 PM
As far as I'm aware, there's no way to edit the underlying record ID. Similarly, the record ID is the key which is used for any update or delete action via the API. That beta feature that you linked could solve your issue, but I'm not familiar with the specific tool you're using to make calls.
Your other options are to 1) Query for the record you're trying to update by your custom ID, and perform a second update call or 2) Store the Airtable record ID in your external database and make calls using the record ID on file.
Feb 05, 2023 05:28 AM
If you can, you’re typically better off using Make.com to do your Airtable upserts. They created their own upsert module for Airtable which is significantly more robust & easier to use than Airtable’s upsert command, and they’ve had it for years before Airtable implemented their weak upsert command.