Basics

The most basic field consists of only a key and label. The field’s key is its unique identifier, and will be the key of that field in the result JSON object. The field’s label is how it will be displayed to the user.
  • Schema
  • Review screen
  • Results
A basic schema could look like this:
fields: [
  {
    label: "First name",
    key: "firstName"
  },
  {
    label: "Last name",
    key: "lastName"
  },
  {
    label: "Membership ID",
    key: "memberId"
  }
]
The user would then match these fields to the columns in their imported file, resulting in a review screen which looks like this: The review screen with data And, when submitted, Dromo would provide you with a result data array like this:
[
  {
    "firstName": "Richard",
    "lastName": "Wysocki",
    "memberId": "38008"
  },
  {
    "firstName": "Paige",
    "lastName": "Pierce",
    "memberId": "29190"
  },
  {
    "firstName": "Paul",
    "lastName": "McBeth",
    "memberId": "27523"
  },
  {
    "firstName": "Kristin",
    "lastName": "Tattar",
    "memberId": "73986"
  },
  {
    "firstName": "Calvin",
    "lastName": "Heimburg",
    "memberId": "45971"
  },
  {
    "firstName": "Catrina",
    "lastName": "Allen",
    "memberId": "44184"
  },
  {
    "firstName": "Eagle",
    "lastName": "McMahon",
    "memberId": "37817"
  }
]

Field object reference

label
string
required
The human-friendly name of the field, shown to the user in the Dromo Uploader interface
key
string
required
The field’s unique identifier, used as the key in the JSON results
type
FieldType
default:"string"
The field’s type.Can be supplied in two formats:
  • As a string corresponding to a valid field type. If the field type accepts options, defaults will be used.
  • For field types which accept options, as a two element array where the first element is the string corresponding to a valid field type, and the second element is an object with type options.
For more details, see field types.
description
string
An optional description of this field for the user. If you specify a value for this field, Dromo will show a ? icon in the importer that users can hover over to see this message.
alternateMatches
string[]
An array of alternate matches that this field to map to. See column matching.
validators
Validator[]
An array of validator objects to validate this field. See validators.
selectOptions
{ label: string, value: string, alternateMatches?: string[] }[]
For select fields only, an array of possible picklist values. See the select field type.
readOnly
boolean
default:"false"
If true, the user will not be able to edit the data in this field.This is useful if you want to exclusively populate a virtual field using hooks.
hidden
boolean
default:"false"
If true, the field will be hidden from the user at all times. A hidden field can be set only using hooks.A user will not be able to match a column of data to the field. A user will not see the field in the review screen. The field will only be added to the submitted final result.Since a user cannot change the value of a hidden field, no validations can be set on a hidden field.
requireMapping
boolean
default:"false"
If true, the field must be mapped when matching columns. The user will not be able to progress to the data review screen unless this field has been matched to a column in the input file.Note: cells in this column aren’t required to have any values, that can be validated using the validator required.
manyToOne
boolean
default:"false"
If true, the field may have multiple data columns mapped to it.The result payload will have an array of all mapped columns’ values instead of just a single value. Row hooks will have an entry in a manyToOne array for each mapped column.

Column matching

During the column matching step, Dromo will try to match columns headers in the user data to a corresponding label or key within your fields. If you want to provide additional aliases that should automatically match to a given field, you can do so by setting alternateMatches for that field. Column matching is case-sensitive. Example:
{
  label: "City",
  key: "city",
  alternateMatches: ["municipality", "town", "locality"]
}