Trouble using field filtering in Airtable API with Apple Shortcuts

I’m stuck trying to use the Airtable API in the Shortcuts app on my iPhone. I can get records using the maxRecords parameter just fine. But when I try to filter by fields, it’s not working.

Here’s what I’ve tried:

GET /v0/myBase/myTable?maxRecords=3

This works great and returns 3 records. But when I try to filter by fields like this:

GET /v0/myBase/myTable?fields=['Name']

I get an error about invalid parameters. I’ve looked at the docs over and over but can’t figure out what I’m doing wrong.

Has anyone successfully filtered Airtable records by field using the API in Shortcuts? What am I missing here? Thanks for any help!

hey there! i’ve had similar issues with airtable api in shortcuts. try changing the square brackets to curly braces like this:

GET /v0/myBase/myTable?fields={‘Name’}

that worked for me. also make sure your field name is exactly right, capitalization matters. hope this helps!

I’ve been using Airtable API with Shortcuts for a while now, and I can tell you that field filtering can be tricky. The issue you’re facing is likely due to URL encoding. When working with complex parameters in URLs, especially in Shortcuts, you need to properly encode them.

Try this approach:

  1. First, create a dictionary in Shortcuts with your field names as keys.
  2. Then, use the ‘Get Dictionary’ action to convert it to JSON.
  3. URL encode the resulting JSON string.
  4. Finally, append this encoded string to your API call.

So your final URL might look something like:

GET /v0/myBase/myTable?fields=%7B%22Name%22%3A%20true%7D

This method has worked consistently for me across various Shortcuts and Airtable bases. Let me know if you need any clarification on the steps!

I’ve encountered this issue before when working with Airtable’s API in Shortcuts. The problem lies in how Shortcuts handles URL encoding for complex parameters. Here’s a workaround that’s proven effective:

Instead of using brackets or braces, try using comma-separated values for multiple fields:

GET /v0/myBase/myTable?fields=Name,Status,Date

For single fields, you can simply use:

GET /v0/myBase/myTable?fields=Name

This approach bypasses the need for special encoding and should work seamlessly within Shortcuts. Remember to ensure your API key is correctly set in the request headers.

If you’re still encountering issues, double-check your base ID and table name for any typos. Also, consider using the ‘Get Contents of URL’ action in Shortcuts for more control over your API requests.