When embedding Flatfile, this plugin should be deployed in a server-side
listener. Learn more
@flatfile/plugin-json-extractor
The
@flatfile/json-extractor
plugin parses a JSON file and extracts first-level nested objects as Sheets in Flatfile.Event Type:
listener.on('file:created')
Supported file types:
.json
Parameters
The
chunkSize
parameter allows you to specify the quantity of records to in
each chunk.The
parallel
parameter allows you to specify the number of chunks to process
in parallel.API Calls
api.files.download
api.files.get
api.files.update
api.jobs.ack
api.jobs.complete
api.jobs.create
api.jobs.fail
api.jobs.update
api.records.insert
api.workbooks.create
Imported NPM Packages
@flatfile/api@1.4.9+
@flatfile/hooks@1.3.0+
@flatfile/listener@0.3.15+
@flatfile/util-extractor@0.3.0
provides utility functions for extracting and parsing data from various file formats and sources, streamlining data import processes.
Usage
Listen for a JSON file to be uploaded to Flatfile. The platform will then extract the file automatically. Once complete, the file will be ready for import in the Files area.Install
import
listener.js
Full Example
In this example, theJSONExtractor
is initialized, and then registered as middleware with the Flatfile listener. When a JSON file is uploaded, the plugin will extract the structured data and process it the extractor’s parser.