Skip to main content

Using Fields filter in List of records

  • June 4, 2016
  • 3 replies
  • 84 views

I have been trying for several hours to get the fields parameter for the list records request to work. I am sending an HTTP Get request with python, I have the filterByFormula field working but cannot get the fields parameter to work. Could someone please post an example of the fields tag and an example field in a working query string format?

Thanks

3 replies

Forum|alt.badge.img+9
  • Participating Frequently
  • June 5, 2016

The fields parameter should be a URL-encoded array. For example, if you want to include two fields called “Notes” and “Attachments”, the fields array would be:

["Notes", "Attachments"]

When URL-encoded, this ends up looking like:

fields[]=Notes&fields[]=Attachments

So the full URL would be:

https://api.airtable.com/v0/appId/TableName?fields[]=Notes&fields[]=Attachments

You can check out http://api.jquery.com/jquery.param/ as a reference implementation of URL-encoding objects and arrays. e.g. jQuery.param({fields: ["Notes", "Attachments"]}).


  • Participating Frequently
  • June 5, 2016

The fields parameter should be a URL-encoded array. For example, if you want to include two fields called “Notes” and “Attachments”, the fields array would be:

["Notes", "Attachments"]

When URL-encoded, this ends up looking like:

fields[]=Notes&fields[]=Attachments

So the full URL would be:

https://api.airtable.com/v0/appId/TableName?fields[]=Notes&fields[]=Attachments

You can check out http://api.jquery.com/jquery.param/ as a reference implementation of URL-encoding objects and arrays. e.g. jQuery.param({fields: ["Notes", "Attachments"]}).


I’ve always has issue with the length of the fields parameter, especially when you require only 20 out of 30 fields, you end up with a ridiculously long string. Does anyone know of a way to reduce the size so that you don’t end up with a string of endless &fields[] =blah&fields[]=blahblah&fields[]=…


Oli_Steadman
Forum|alt.badge.img+16
  • Known Participant
  • March 25, 2019

I am confused as to why this isn’t yet a feature… seems really odd to have to declare multiple values for ‘fields’ … especially in a program like Alteryx, this will not be an accepted protocol.