Skip to main content
Solved

Get visible fields in a specific view


Is it possible to get visible fields for a chosen table and view? I checked the Airtable scripting documentation and I cannot find the property to check if a field is visible for that view

Best answer by JonathanBowen

Hi @Carmel94 - you can get information about the fields in a table, but not from a view. The fields from the table will be all fields.


for (let field of base.getTable("Table").fields) {
    output.text(`Field "${field.name}" (${field.type}) options:`);
    output.inspect(field.options);
}

=======================

Want to learn Airtable Scripting? 1 day bootcamp coming soon!

=======================

View original
Did this topic help you find an answer to your question?

2 replies

JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • 1110 replies
  • Answer
  • May 27, 2021

Hi @Carmel94 - you can get information about the fields in a table, but not from a view. The fields from the table will be all fields.


for (let field of base.getTable("Table").fields) {
    output.text(`Field "${field.name}" (${field.type}) options:`);
    output.inspect(field.options);
}

=======================

Want to learn Airtable Scripting? 1 day bootcamp coming soon!

=======================


Forum|alt.badge.img+17
JonathanBowen wrote:

Hi @Carmel94 - you can get information about the fields in a table, but not from a view. The fields from the table will be all fields.


for (let field of base.getTable("Table").fields) {
    output.text(`Field "${field.name}" (${field.type}) options:`);
    output.inspect(field.options);
}

=======================

Want to learn Airtable Scripting? 1 day bootcamp coming soon!

=======================


Check out the Airtable API documentation, you should be able to improvise a fetch request that will retrieve the data you need. Filtering views is a typical use case for the API. As to why this kind of behavior isn’t more readily available from within the Scripting app, :man_shrugging:


Reply