This guide demonstrates how to use step hooks to add or remove fields midway through an import.
For more information on the instance.addField method, see the Reference documentation. For more information on the instance.removeField method, see the Reference documentation.
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;
});