Skip to content

Instantly share code, notes, and snippets.

@douglaslassance
Last active December 12, 2020 21:34
Show Gist options
  • Save douglaslassance/0ba26f2cf2aa9bb21a521ba07d751244 to your computer and use it in GitHub Desktop.
Save douglaslassance/0ba26f2cf2aa9bb21a521ba07d751244 to your computer and use it in GitHub Desktop.
// Go to https://airtable.com/api and select a base.
// Then open your browsers console (Ctrl+Alt+I) and run the following code.
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);
@edsu
Copy link

edsu commented Dec 12, 2020

This code no longer seems to work since window.application is undefined?

@edsu
Copy link

edsu commented Dec 12, 2020

My bad, I wasn't running it while looking at the API docs but when I was viewing the base. It works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment