Installation

Licensing

You need a license key to get started. Sign up or login to configure a code snippet that is ready to copy and paste.

During your free trial you'll be able to:

  • Upload files with up to 100 rows
  • View your Flatfile support dashboard
  • See your file import history
  • Track uploads per user
  • As well as try any of our paid features which allow xls support, custom CSS, data healing, server-side processing.

You can see the basic code snippet you'll need to get started in the demo video above. This snippet is available in our Vanilla jQuery CodeSandbox

Using NPM

If you don't like external dependencies, or you have a nice build system like Webpack in place. You can install and use Flatfile as an npm package.

npm install flatfile-csv-importer --save

ES6 / Babel Usage

Use the .load() method instead of the .open() method to get a Promise response. The promise will resolve when the user has completed the import and mapping process.

import FlatfileImporter from 'flatfile-csv-importer'
import $ from 'jquery'
// configure your flatfile options here
const options = {}
// initialize the importer
const importer = new FlatfileImporter(FLATFILE_LICENSE_KEY, options)
// setup your handler
const buttonClickHandler = async () => {
try {
const results = await importer.requestDataFromUser()
await uploadYourData(results.data)
} catch(e) {
// handle a failed upload
}
}
const uploadYourData = (data) => {
// logic here to upload the clean data your server
}
$("#upload-button").click(buttonClickHandler)