Skip to main content

Concatenating and splitting fields

This guide demonstrates how to use step hooks to add or remove fields midway through an import.

Reference

For more detail about the instance.addField method, see the Reference page. For more detail about the instance.removeField method, see the Reference page.

dromo.registerStepHook("REVIEW_STEP", function (instance, data) {
instance.addField({
label: "Full Name",
key: "fullName",
});
});

dromo.registerStepHook("REVIEW_STEP_POST_HOOKS", function (instance, data) {
instance.removeField("firstName");
instance.removeField("lastName");
});

dromo.registerRowHook(function (data, mode) {
let out: IRowHookOutput = { row: {} };
if (data.row.firstName && data.row.lastName && mode === "init") {
out.row = {};
out.row.fullName = {
value: data.row.firstName.value + " " + data.row.lastName.value,
info: [
{
message: "combined first and last name into full name",
level: "info",
},
],
};
}
return out;
});