Import Module Content
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Overwrites an existing module with module XML, usually XML created by Export Module Content. The module keeps its Module Id and its place on the page, but gets the definition, settings and content from the XML.
The module's current content is replaced and can't be recovered. If the XML is for a different module type, the module's type changes too. For example, importing Action Form XML into an HTML module turns it into an Action Form.
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 to a new page: Create Page, Add Module, then import the XML of a template module
- Restore a module from XML you saved earlier with Export Module Content
- Deploy the same module configuration to several pages
Don't use it to
- Import XML from users or other untrusted sources. The XML can change the module's type, settings and content.
- Change only the text of an HTML module. Use Update HTML Module instead.
- Place the same module on another page. Use Add Existing Module instead.
- Create a module. The target module must already exist.
Related Actions
| Action Name | Description |
|---|---|
| Export Module Content | Exports a module as XML. |
| Add Module | Adds a new module to a page, to import into. |
| Add Existing Module | Adds an existing module, or a copy of it, to a page. |
| Update HTML Module | Replaces the content of an HTML module. |
| Delete Module (Soft) | Moves a module to the recycle bin. |
| Create Page | Creates a new page. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Module ID | The Module Id of the module to overwrite, for example [NewModuleId]. It must be a positive number, and the module must be in the current portal. | Yes | empty string | Yes |
| Imported Module Content | The module XML, usually the token filled by Export Module Content, for example [ModuleXml]. The XML must contain a <module> element. | Yes | empty string | Yes |
Output Parameters Reference
This action doesn't have output parameters.
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: ... - Imported Module Content is empty:
No module content was provided. - 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. - The module's page can't be found:
Tab with the ID ... was not found. - The XML has no
<module>element:Module definition was not found in the module content XML. - The import itself fails. End users see
There was an error with the form. Please contact the administrator or check logs for more info.
Content that isn't valid XML also fails with an XML parsing error.
Considerations
- It's a replace, not a merge. How the content part is imported depends on the module type. Test the result on a copy first.
- No permission check. The action doesn't check whether the current user can edit the module. Limit who can run it with the form's permissions or the action's
Condition. - Import into a new module. The safest pattern is to add an empty module with Add Module and import into it, so no existing content is lost.
- Mind the product versions. The XML records the version of the module that exported it. Import into a site with the same module installed.
- The XML is logged. At debug log level, the full XML is written to the log.
Examples
To understand how to use the below examples, please see Running Examples.
1. Copy a template module to a new module
This action overwrites the module whose Module Id is in [NewModuleId] with the XML in [ModuleXml], created earlier with Export Module Content. It runs only when [NewModuleId] has a value. Don't test [ModuleXml] in a condition, because the XML contains quotes.
{
"Title": "Import Module Content",
"ActionType": "ImportModuleContent",
"Description": "Copy the template module into the new module",
"Condition": "[NewModuleId] != \"\"",
"Parameters": {
"ModuleId": "[NewModuleId]",
"ModuleContent": "[ModuleXml]"
}
}
Revised 09/27/2026