I’m stuck trying to use the Airtable API in the Shortcuts app on my iPhone. I can get a list of records using the ‘maxRecords’ parameter, but I’m having trouble with the ‘fields’ parameter for filtering.
Here’s what works:
https://api.airtable.com/v0/MyDatabase/MyTable?maxRecords=3
But when I try to use the ‘fields’ parameter like this:
https://api.airtable.com/v0/MyDatabase/MyTable?fields=['Title']
I get an error saying the request is invalid. I’ve looked at the API docs but can’t figure out what I’m doing wrong. Any ideas on how to properly filter records using the Airtable API in Shortcuts?
I’ve been using Airtable API with Shortcuts for a while now, and I can share some insights. The ‘fields’ parameter can be tricky. Instead of using brackets, try using comma-separated values for multiple fields. Like this:
https://api.airtable.com/v0/MyDatabase/MyTable?fields=Title,Description,Date
Also, make sure you’re including your API key in the headers of your request. That’s a common oversight.
If you’re looking to combine filtering with field selection, you can use the ‘filterByFormula’ parameter. For example:
https://api.airtable.com/v0/MyDatabase/MyTable?fields=Title&filterByFormula={Status}=‘Active’
This will return only the ‘Title’ field for records where the ‘Status’ is ‘Active’. Hope this helps!
hey there! i had similar issues with airtable api in shortcuts. try encoding the brackets in the url:
https://api.airtable.com/v0/MyDatabase/MyTable?fields[]=Title
that should work for filtering by field. let me kno if u still have trouble!