Moving to Portal v2

If you're looking to move to Flatfile Portal version 2 from version 1, then this guide will show you the recommended steps to upgrade and the differences in configuration.

If you're on version 1 and using NPM, install the new Portal adapter.

After installing, your package.json should reflect version 2.0.0 or higher.

If you are going the NPM route, you'll want to make sure to remove the old dependncy from your code as the two versions assume you're using different versions of Flatfile by default.

npm uninstall flatfile-csv-importer

If you're loading Flatfile via CDN, change the CDN link to

https://unpkg.com/@flatfile/adapter/build/dist/index.min.js
.

Configuration Changes

We've updated how some of the configuration works to consolidate everything into only one way to initialize features. Here are the specifics:

label:

All of configurations within fields must now have a label.

validator:

We've deprecated the single validator configuration, and now all validators will be used in the validators configuration.

isRequired:

The isRequired configuration key has been deprecated, and all validators will need to be put within the validators array.

Regex changes

All regex shorthands (email, boolean, numeric) have been deprecated.

All regex values now need to be a string. Because of this, there can be issues with escaping certain characters. If you need help with escaping, use this tool: click here.

Select Options

Options may no longer use an array of strings, and must all use an array of objects with both value and label keys.

Setting the Customer

One final requirement on version 2 is that the

setCustomer
method is now required. This method is where you will identify the user that is uploading a file. There are 5 keys that can be used for this object, but the
userId
is the only one that is required to be passed in.

Once you've updated your version and changed your Flatfile config, you're free to start using some of the new features on version 2.