Last active
June 8, 2022 01:40
-
-
Save diva-D/c1a202c5508a00dbec65f0437090adab to your computer and use it in GitHub Desktop.
Visit https://airtable.com/api and select a base. Then open your browsers console (Developer Tools) and run the following https://community.airtable.com/t/metadata-api-for-schema-and-mutating-tables/1856/6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myapp = { | |
id:window.application.id, | |
name:window.application.name, | |
tables:[] | |
}; | |
for (let table of window.application.tables){ | |
var mytable = { | |
id:table.id, | |
isEmpty:table.isEmpty, | |
name:table.name, | |
nameForUrl:table.nameForUrl, | |
primaryColumnName:table.primaryColumnName, | |
columns:[] | |
}; | |
for (let column of table.columns){ | |
var mycolumn = { | |
id:column.id, | |
name:column.name, | |
type:column.type, | |
typeOptions:column.typeOptions | |
}; | |
mytable.columns.push(mycolumn); | |
} | |
myapp.tables.push(mytable); | |
} | |
jQuery('link[rel=stylesheet]').remove(); | |
jQuery("body").html(JSON.stringify(myapp)); | |
console.log(myapp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment