Help

Re: Using your own recId to update data

1894 0
cancel
Showing results for 
Search instead for 
Did you mean: 
jfoxworth
5 - Automation Enthusiast
5 - Automation Enthusiast

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:

  • Create a record with my own recId - so that I can then update it later using this ID
  • Enter a value on another field - line myId - and then use this field later to update the record
  • Set the AirTable ID based off of something else - so that I can recalculate it later

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.

2 Replies 2
bazfilmer
6 - Interface Innovator
6 - Interface Innovator

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.

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.