Trouble using Airtable API field filters in iOS Shortcuts

I’m having issues with the Airtable API in my iOS Shortcuts workflow. I can get records using the ‘maxRecords’ parameter just fine:

https://api.airtable.com/v0/MyDatabase/MyTable?maxRecords=3

But when I try to use the ‘fields’ parameter to filter specific columns, it’s not working:

https://api.airtable.com/v0/MyDatabase/MyTable?fields=['Column1']

I keep getting an error about invalid request and parameter validation failing. I’ve read the docs over and over but can’t figure out what I’m doing wrong. Any ideas on how to properly filter fields using the Airtable API in Shortcuts? Thanks!

I’ve been working with the Airtable API in Shortcuts for a while now, and I think I know what’s causing your issue. The problem is likely how Shortcuts handles special characters in URLs. Here’s what worked for me:

Instead of using square brackets, try using parentheses for the fields parameter. Also, make sure to URL encode the entire parameter string. Your URL should look something like this:

https://api.airtable.com/v0/MyDatabase/MyTable?fields=(Column1)

Then, use the ‘URL Encode’ action in Shortcuts on the entire URL before making the API request. This approach has consistently worked for me when filtering fields.

Another tip: if you need multiple fields, separate them with commas inside the parentheses, like this: fields=(Column1,Column2,Column3)

Hope this helps you get your workflow running smoothly!

I encountered a similar problem when working with Airtable and iOS Shortcuts. In my experience, the issue wasn’t with the API itself but with how URL encoding is managed in Shortcuts. I solved this by taking the text representing my field parameters and encoding it before appending it to the URL. By doing so, the fields were transmitted correctly and avoided the validation error. I suggest trying a separate encoding step for the field parameter and ensuring that the quotes used match those outlined in the Airtable documentation.

hey there, i had the same issue! try using url encoding for the fields parameter. in shortcuts, use the ‘URL Encode’ action before adding it to your request. should look something like this:

fields%5B%5D=Column1

hope this helps!