code: function importForm(req, res, next) {
    req.appformsResultPayload = req.appformsResultPayload || {};
    var formData = (req.appformsResultPayload.data && req.appformsResultPayload.type === constants.resultTypes.formTemplate) ? req.appformsResultPayload.data : undefined ;
  
    var importFormParams = {
      form: formData,
      name: req.body.name,
      description: req.body.description,
      userEmail: req.user.email
    };
  
    logger.debug("Middleware: importForm form: ", {params: importFormParams});
  
    forms.cloneForm(_.extend(req.connectionOptions, importFormParams), formsResultHandlers(constants.resultTypes.forms, req, next));
  }
docs: Importing A Form From A Template