API - When Using A View, Return Only Its Visible Columns


#1

Currently, when you retrieve records through the API and specify a view, only those records that are visible through the view are returned, and they are returned in the order in which they are displayed. This is a noce feature, and I use it often.

It would also help if the API returned only the columns that are visible through the specified view. In other words, any hidden columns would be excluded from the result. I believe that this would help both in terms of security and performance.

~ Tim


#2

Yes, please! I was quite surprised by how much unnecessary data was returned by the API - seems like that’s very much the point of having the views in the first place!


#3

Is this why I am getting a super-set of the expected output when doing a Node retrieval request? I was expecting Output 1 but am getting Output 2:

Output 1:
{
“id”: “recoubblcbUlQ4dkv”,
“fields”: {
“Name”: “Embraer E190”,
“Type”: “Embraer E190”,
“Airplanes”: [
“recoBQnUDUlFWjq59”,
“recbwDn7RswDy6TwW”
],
“RecID”: “recoubblcbUlQ4dkv”
},
“createdTime”: “2016-01-08T00:33:47.000Z”
}

Output 2
{"_table":{"_base":{"_airtable":{"_apiKey":"","_endpointUrl":“https://api.airtable.com”,"_apiVersion":“0.1.0”,"_apiVersionMajor":“0”,"_allowUnauthorizedSsl":false,"_noRetryIfRateLimited":false},"_id":""},“id”:null,“name”:“Types”},“id”:“recoubblcbUlQ4dkv”,"_rawJson":{
“id”:“recoubblcbUlQ4dkv”,
“fields”:{
“Name”:“Embraer E190”,
“Notes”:“Note\n\n”,
“Type”:“Embraer E190”,
“Airplanes”:[
“recoBQnUDUlFWjq59”,
“recbwDn7RswDy6TwW”
],
“RecID”:“recoubblcbUlQ4dkv”
},“createdTime”:“2016-01-08T00:33:47.000Z”
}
,“fields”:{“Name”:“Embraer E190”,“Notes”:“Note\n\n”,“Type”:“Embraer E190”,“Airplanes”:[“recoBQnUDUlFWjq59”,“recbwDn7RswDy6TwW”],“RecID”:“recoubblcbUlQ4dkv”}}


#4

Hi!

We just released an API update that lets you limit which fields are returned in results, as well as filtering which records are returned.

You can read more about it on our blog or in the API documentation.


#5

It looks like you’re printing the record object directly. To get the field values use the get method on the record object. e.g. to get the notes for a record: record.get('Notes').

We don’t currently have a way of automatically getting all the field values as an object, but will consider adding it in the future.