Add Existing Module
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Adds a module that's already on one page to another page. By default the new instance is shared with the original: it's the same module, so its content and settings are the same on both pages. Turn on Make A Copy to create an independent copy instead.
This action is part of the Portal Management add-on, which is installed and licensed separately (feature package PORTAL). If it isn't licensed, the action fails with a not-licensed error.
Typical Use Cases
- Show the same banner, contact block or menu module on several pages, and edit it in one place
- Copy a configured module from a template page to a new page made with Create Page
- Build a page from parts of other pages
Don't use it to
- Create a new, empty module. Use Add Module instead.
- Move a module. The original stays on the source page. Remove it afterwards with Delete Module (Soft) if you want a move.
Related Actions
| Action Name | Description |
|---|---|
| Add Module | Adds a new, empty module to a page. |
| Load Module | Reads a module's settings into tokens. |
| Update Module | Changes a module's title, display options, dates and permissions. |
| Delete Module (Soft) | Removes a module instance from a page to the Recycle Bin. |
| Delete Module (Hard) | Removes a module instance from a page permanently. |
| Export Module Content | Exports a module's content. |
| Create Page | Creates the destination page. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Source Tab | The page that has the module. Pick a page, or use an expression that resolves to a Tab ID. It must be a page in the current portal. | Yes | none | Yes |
| Destination Tab | The page to add the module to. Pick a page, or use an expression that resolves to a Tab ID. It must be a page in the current portal. | Yes | none | Yes |
| Module Type | Filters the Module list to one type of module on the source page. It's only a helper for picking the module and isn't used when the action runs. | Yes | none | No |
| Module | The module to add. Pick it from the list, or use an expression that resolves to a module ID. The module must be on the source page. | Yes | none | Yes |
| Pane | The name of the skin pane to place the module in on the destination page. | Yes | ContentPane | No |
| Position in the pane | Top (0) or Bottom (-1), or an expression that resolves to a whole number. If empty or not a number, the module goes to the bottom. | Yes | Bottom | No |
| Make A Copy | Off: the new instance is shared with the original module. On: an independent copy is created. | Yes | false | No |
| Output Module Id Token | The name of a token to receive the module ID of the added module. For example, AddedModuleId gives you [AddedModuleId]. Leave empty if you don't need it. | No | empty string | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Output Module Id Token | The token named here receives the module ID. For a copy, it's the new module's ID. For a shared instance, it's the original module's ID, because both pages use the same module. |
Shared instance or copy
| Shared (Make A Copy off) | Copy (Make A Copy on) | |
|---|---|---|
| Module ID | Same as the original | A new module ID |
| Content | The same content. Edits show on both pages. | Copied once. After that, the two modules are independent. |
| Module settings | Shared | Copied |
| Page-specific settings (tab module settings) | Copied | Copied |
| Deleting one instance | The other page keeps its instance | The other module isn't affected |
Content is copied only for modules that support DNN's import and export (IPortable). For other module types, a copy gets the settings but not the content.
Considerations
- The action needs a portal. Both pages are looked up in the current portal. The action fails with
Couldn't find the source tab with the id ...orCouldn't find the destination tab with the id ...when a page can't be found. - Other failures return a general message. If the module isn't on the source page, or DNN can't add it, the action fails. Administrators see
Could not add the module (ModuleId: ... from the page ... to the page ..., and other users seeSomething went wrong. Please contact the site administrators for help. - The page stylesheet may be copied. If the source page has a custom stylesheet and the destination page has none, the source page's stylesheet is set on the destination page too.
- Shared instances are affected by changes to the module. For example, Update Module permissions and dates belong to the module, so they apply on every page that shows it.
- There's no permission check in the action. Anyone who can run it can place modules on any page in the portal. Only run it where trusted users can reach it.
Examples
To understand how to use the below examples, please see Running Examples.
1. Share a contact module on a new page
This action adds module 412 from page 57 to the page in [NewPageId], at the top of the ContentPane. The module is shared, so editing it on either page changes both.
{
"Title": "Add Existing Module",
"ActionType": "AddExistingModule",
"Description": "Share the contact module on the new page",
"Parameters": {
"SourceTabId": "57",
"DestinationTabId": "[NewPageId]",
"ModuleId": "412",
"PaneName": "ContentPane",
"Position": "0",
"MakeACopy": "false",
"OutputToken": "ContactModuleId"
}
}
2. Copy a module from a template page
This action copies the module in [TemplateModuleId] from the page in [TemplatePageId] to the page in [NewPageId], and saves the new module's ID in [CopiedModuleId]. It runs only when a template module is set.
{
"Title": "Add Existing Module",
"ActionType": "AddExistingModule",
"Description": "Copy the template module to the new page",
"Condition": "[TemplateModuleId] != \"\"",
"Parameters": {
"SourceTabId": "[TemplatePageId]",
"DestinationTabId": "[NewPageId]",
"ModuleId": "[TemplateModuleId]",
"PaneName": "ContentPane",
"Position": "-1",
"MakeACopy": "true",
"OutputToken": "CopiedModuleId"
}
}
Revised 09/27/2026