Skip to main content
Version: 1.28 (Current)

Export Module Content

Audience: Low-code Engineers

Skill Prerequisites: Actions, Tokens

Exports a module as XML and saves the XML in a token. The XML holds the module's definition and settings, and its content when the module supports DNN content export (IPortable).

Use Import Module Content to load the XML into another module.

note

This action is part of the Portal Management add-on. The add-on is installed and licensed separately (feature package PORTAL). If the feature package isn't licensed, the action fails with a not-licensed error.

Typical Use Cases​

  • Copy a configured module, for example a form or an HTML module, to another page together with Import Module Content
  • Back up a module's configuration before changing it
  • Save a module's XML to a file or a database table as a template

Don't use it to​

  • Read only the text of an HTML module. Use Load HTML Module instead.
  • Read a module's properties, such as its title or pane. Use Load Module instead.
  • Place the same module on another page. Use Add Existing Module instead.
  • Export modules from another portal. Only modules in the current portal can be exported.
Action NameDescription
Import Module ContentOverwrites a module with exported XML.
Export PageExports a whole page, with its modules and content, as XML.
Add Existing ModuleAdds an existing module, or a copy of it, to a page.
Load ModuleLoads the properties of a module.
Load HTML ModuleReads the content of an HTML module.
Add ModuleAdds a new module to a page.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Module IDThe Module Id of the module to export, for example [SourceModuleId]. It must be a positive number.Yesempty stringYes
Module Content Output TokenThe name of the token that receives the XML, for example ModuleXml.Noempty stringNo

Output Parameters Reference​

ParameterDescription
Module Content Output TokenThe token named in this parameter holds the exported XML. The root element is <module>, with the module type and version as attributes. The module's content, if any, is in a <content> element.

Errors​

The action raises an error when:

  • Module ID is empty: No module ID was provided.
  • Module ID isn't a positive number: ModuleID parameter was not valid, received: ...
  • The module doesn't exist: Module with module Id ... was not found.
  • The module belongs to another portal: Module with module Id ... does not belong to current portal.

Considerations​

  • Content depends on the module. Modules that support content export, such as the DNN HTML module and Plant an App modules like Action Form, include their content. Other modules export only their definition and settings.
  • Content errors aren't raised. If the module fails to export its content, the error is written to the log and the XML is returned without the <content> element. Check for <content in the result if you rely on it.
  • No permission check. Any user who runs the action can export any module in the portal. The XML can include settings and configuration you may not want to show, so don't display it to end users.
  • Set the output token. If Module Content Output Token is empty, the export runs but the XML isn't saved.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Export a module to a token​

This action exports the module whose Module Id is in [SourceModuleId] and saves the XML in [ModuleXml].

{
"Title": "Export Module Content",
"ActionType": "ExportModuleContent",
"Description": "Export the template module",
"Parameters": {
"ModuleId": "[SourceModuleId]",
"ModuleContent": "ModuleXml"
}
}

Revised 09/27/2026