May 18, 2022 10:43 PM
I’m trying to setup a simple API but I’m not exactly sure what APIs to use.
I want to check for a unique value in a field (userID) and return the RecordID.
If recordID exists, overwrite record with new data
If recordID doesn’t exist, create new record with data
At the moment I’m stuck on 1. I’ve tried List Records, using filterbyFormula & the API Encoder tool, Retrieve a record, I just can’t get the single results returns like I’m after.
Can someone please provide me with an example API request to for number 1? If you could help with the others that would also be really great but at the moment 1 is where I’m stuck.
I know it’s a really simple API setup but I’m new to this and have been trying for hours. I have also posted to the Airtable forum but my posts aren’t getting approved for some reason.
Thanks so much.
May 20, 2022 12:16 AM
What’s wrong with the results you’re getting?
Here’s one I just tried that works for me:
https://api.airtable.com/v0/[APP ID]/[TABLE ID]?filterByFormula=AND(Name%3D%22Bob%22%2C+Notes%3D%222%22)
The formula is: AND(Name="Bob", Notes="2")
May 20, 2022 05:47 AM
Have you verified that the exact formula you are using also works in a formula field?
Trying for hours when working with your first API sounds normal. APIs can be finicky and you have to get everything exactly right.
Jul 29, 2023 05:35 AM
If you’re having difficulty coding, you can very easily do what you want in a no-code/low-code manner with Make’s Airtable automations & integrations.
In particular, you can easily use Make’s “search and upsert” functionality to do this. Check out the screenshot below.
There can be a bit of a learning curve with Make, which is why I created this basic navigation video for Make, along with the links to a few other Make training resources.