Implementing Custom Fields
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

This article is for Flatfile's Portal 2.0, Portal 3.0, and Workspaces. If you'd like to check out the latest version of the Flatfile Data Exchange Platform, click here!

Custom fields can be enabled in any of our products to allow end users to add fields to the template if they need to import additional information that isn't included in the original template. The field name will be the column header in the original file.

Portal 3.0 and Workspaces

In Portal 3.0 and Workspaces, custom fields are enabled when deploying your sheets by using the allowCustomFields sheet option in the Flatfile Platform SDK. Other options that are available can be found in our developer documentation.

Once the feature is enabled, your users can create custom fields when they import data and reach the matching step. To create a custom field, click on the drop-down menu under Template fields and select "Add as custom field" at the bottom of the list. The field will appear in the final data review step, where data can be reviewed and edited.

Dropdown to add as custom field

Define Custom Fields at Runtime

Using the runtime custom field feature available in Portal 3.0, you can also define custom fields specific to a user or session being launched, rather than relying on your users to add those custom fields.

This feature requires that the fields are defined in your Portal 3.0 configuration, and that the sheet they are being added to has the allowCustomFields option set to true.

Custom fields are remembered in Flatfile Workspaces

Custom fields that were previously uploaded will be automatically added to the Template fields drop-down menu as optional fields. Your customer can then match to them when importing new data.

Future imports to the same template in the same Workspace will see those fields in the dropdown, with a “custom” label next to them.

Portal 2.0

In Portal 2.0, they can be enabled by including

allowCustom: True

in your config when implementing Flatfile Portal 2.0. Other options available can be found in our developer documentation here.

Q&A

How is a custom field name (label) determined? The field’s name (label) will be determined automatically from the field header in the uploaded file. For example, in the screenshot above “Phone” will be created as a custom field.

How is a custom field internal key determined? Custom fields will be created with an internal key of "custom_[label]. The label will be set in lowercase, and any spaces will be changed to underscores. For example, a custom field with the name “Phone” will appear as “custom_phone” as an internal key. See example below.

What data type is a custom field? All custom fields are created as string-type.

How will custom fields be identified when fetching data via the API? Records that contain custom fields can be identified with `custom: true`. Below is an example of phone added as a custom field:

"custom_phone": { "value": "1234567890", "custom": true},
Did this answer your question?