This project can be used to extract data from any public Airtable table and write it to a JSON file.
The project includes a table fuser that can be used to combine multiple tables into a single JSON file, with the ability to project columns and rename them, and group rows by a common column (Primary Key).
All possible merging errors are handled with error messages that make it easy to resolve them.
This project is designed to work perfectly with MongoDB.
yarn- Go to the airtable page on your browser
- Go to inspect element
- Go to network tab
- Reload the page (F5)
- Search
readSharedViewDataorreadin the network tab - Click the first or second result
- Go to
Responsetab - Copy the content
- Create a
input.jsonfile in the./inputsdirectory - Paste the content in the file
This will parse all the JSON files in the ./inputs directory and create a file in the ./outputs directory.
yarn startThis will merge all the JSON files in the ./outputs directory and create a merged.output.json file.
yarn mergeWhen you run the yarn merge command for the first time, it will create a fuser.config.ts file in the root directory. You can then edit this file to change the configuration.
{
/**
* The column name that will
* be used to merge the data.
*
* If not provided, there may
* be duplicates in the output.
*/
uniqueKey: 'theColumnId',
/**
* The projection that will be used
* to merge the data.
*
* The key is the column name of the
* Airtable table and the value is the
* column name wanted in the output file.
*/
projection: {
'The column id': 'theColumnId',
'The column name': 'theColumnName',
'the_column_type': 'theColumnType',
},
/**
* Set it to true if you want to remove
* the `_date` column after merging.
*
* This column is used to merge the data.
*
* Default: false
*/
removeDate: false,
}