This is a simple Nodejs script sample that will show how you can programmatically submit Airtable Form automatically using Puppeteer(a Node library to control Chromium-based browser). In this tutorial, I will talk about Puppeteer and Airtable prefill methods to auto-submit forms.
I am assuming you have at least some knowledge in running the Nodejs script. You can use the same method to submit any Airtable data from other data sources (Google Sheet), the only thing you need to consider is to create it as a JSON array. If you are looking for advanced usage, please consider using Airtable API.
I created this script and a Chrome extension (which I will talk about later) for my client when I saw they used to enter so many similar details from websites more than 100 times a day. I would like to let you know that there are some issues when submitting multiple forms simultaneously. If you are looking for prefilling and auto-submitting for so many pages, I would suggest reading this thread.
- Your Airtable Form
- Node.js on your computer ( How to setup Nodejs )
- A Good IDE (mine is VS Code)
- Data in JSON format
- Little JS knowledge (even on How to run Nodejs script would be helpful)
What is Puppeteer?
Puppeteer is a Nodejs library use to control headless Chromium browsers. In layman's terms, you can use this library to do things like making screenshots, browser actions, and many more without opening Chrome. If it doesn't ring a bell, then watch this useful video from Google and read this article.
- Create a folder (pick your name)
- Open that folder in VS Code
- From VS Code terminal, npm init
- Now, install Puppeteer, using npm install puppeteer
- Create index.js
- Copy & paste our code below
- Make necessary changes
Make necessary changes
1) Replace Airtable URL by updating the URL on baseURL from the script.
2) Add prefill variable using prefill_"Variable from Airtable Form". Please note %20 is for space. You don't need it if there is not space. From the below Form image you can see that prefill_Company%20Name, prefill_Company%20Domain is an example.
3) That's it, run the code by node index.js
CSV/Excel to JSON
If your data source is a CSV file, then it's better to use something like online converter.
Google Sheet to JSON
If you have the details on Google sheet and want to convert them into JSON, please check this article or use SheetDB (This is a Makeinfo affiliated product). Please make the decision based on your requirements, if you just need to convert the sheet to JSON.
Finally, you got the working Nodejs script to automatically submit the Airtable form based on your data. I hope this is helpful for you. If you stuck somewhere or need some help, please use the comment section below.