To implement Dromo in your application, you must first define a schema. A schema is an array of field objects. These fields will be matched to columns during the import process, and define the properties of the JSON payload passed back in the results.
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.
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.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.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
.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.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: