Dec 03, 2019 08:46 AM
I have searched the API docs, and I see no way to do this.
With the AirTable API, how do I create a new tab (new table) in an existing base? and then populate it?
I do not see this feature of inserting or creating an new tab into an existing base, only the ability to insert rows into an existing table that was created by a human that opens a web browser and clicks.
We have needs to automate the creation of new tables in an existing base (and down the line, creating new bases programatically).
Dec 03, 2019 09:50 AM
:wave: Developer on Airtable’s API team here.
The Airtable API currently has no way to do this—you can only create new tables from the UI.
Dec 03, 2019 10:10 AM
Great, thank you. Is there any way with the AirTable API, or any 3rd party product to insert a CSV direct into an existing base?
I have a CSV on a file system, and I want to programatically send a CSV to a base and have it inserted into a new tab.
I can’t be the first to request this, it would be helpful, if at all possible. It does not look possible with Zapier. Thank You.
Dec 03, 2019 10:38 AM
There’s no way to import a CSV directly with the API, but you can convert CSV to JSON, which our API accepts.
So rather than CSV → Airtable, you’d do CSV → JSON → Airtable.
Does that make sense?
Dec 03, 2019 10:47 AM
Yes, so where can I find documentation on that? When I goto my Base’s API page, I don’t see anything there, will look again.
And so sending a JSON direct, would this create a new tab in the base? and also do I have control over the naming of that tab? (or positioning?)
thank you,
Dec 03, 2019 11:02 AM
We don’t document that because it’s a bit out of scope, and depends on what exactly you’re trying to do. A quick search shows a few online tools that do this conversion, and you can also look to see how to do it in your favorite programming language (like Python).
There’s a new tab for each table in the base. Again, you can’t create a new table from the API.
Dec 03, 2019 11:08 AM
So the solution is that I have to create a new table manually, always, with the headers I want, and once the table exists, with a header for each field I want to insert, I can then I can make API calls to insert data.
I can send up to ten records at a time, per API call, and I can make up to five of these calls per second, meaning a max of fifty records inserted per second into an existing table.
If I got any of that wrong, please let me know, this is what I am reading in the documentation.
I understand how to take my data and convert to JSON.
I was just hoping that I could create a JSON file of 1K records (rows), and make one call and insert all 1K into a base, creating a new table at the same time and setting the tab name.
Thank you,
Dec 03, 2019 11:09 AM
All of that understanding sounds correct.
We may add support for these features in the API in the future, but they aren’t currently available.
Dec 03, 2019 01:45 PM
Um, yeah - me too. This is a common process for anything automated. It tends to rule out a number of use cases.
Dec 03, 2019 03:11 PM
Here’s a Python script to import a CSV (turning into a JSON object before posting to AT):
JB
Dec 04, 2019 10:54 AM
RE: API Limitations…
Can someone speak to the 10 records per second API limitation? Is this limitation per account or per base? I.e. can we write 10 records to multiple bases at the same time?
Dec 04, 2019 11:30 AM
Hi @Nathan_Beckstead - the API documentation says:
The API is limited to 5 requests per second per base. If you exceed this rate, you will receive a 429 status code and will need to wait 30 seconds before subsequent requests will succeed.
The [official JavaScript client](https://github.com/Airtable/airtable.js) has built-in retry logic.
If you anticipate a higher read volume, we recommend using a caching proxy. This rate limit is the same for all plans and increased limits are not currently available.
The “10 records” thing is that the API allows the creation of records one by one or in batch of up to 10 (with a single request), so at 5 requests per second you could potentially create 50 records per second.
It also notes “per base”, rather than per account or per API key.
JB
Dec 04, 2019 12:34 PM
Got it.
Mr. Bowen, you are a AT Community gem! Just caught your podcast on BuiltOnAir as well. Thank you for all you do for the community!
NAB
Jun 11, 2020 08:09 AM
Is this still true? Has it been updated?
Jul 30, 2021 01:08 AM
I tried the blocks API, it is possible to create a table using an app. I was able to create a table with proper schema, although there is no destroy table in blocks
Oct 18, 2021 07:37 AM
Any updates on this? Is this feature in your backlog?
Dec 16, 2021 04:12 AM
This feature is a huge bottleneck especially in the use case where you have a different table per person – would be awesome if this could be supported!
Apr 27, 2022 04:55 AM
Can we please get an answer please - I have just upgraded to the PRO plan to find out that the “Run a script” function after a trigger does not contain all of the functions contained in the Blocks SDK.
I purchased the plan to specifically to attempt to do this - so will not be renewing the subscription unless we get an answer.