code: function importTheme(req, res, next) {
    req.appformsResultPayload = req.appformsResultPayload || {};
    var themeData = (req.appformsResultPayload.data && req.appformsResultPayload.type === constants.resultTypes.themeTemplate) ? req.appformsResultPayload.data : undefined ;
  
    var importThemeParams = {
      theme: themeData,
      name: req.body.name,
      description: req.body.description,
      userEmail: req.user.email
    };
  
    forms.cloneTheme(_.extend(req.connectionOptions, importThemeParams), resultHandler(constants.resultTypes.themes, req, next));
  }
docs: Importing A Theme From A Template