Add Module
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Adds a new, empty DNN module to a page. You choose the page, the module type and the pane, and you can set the title, display options, visibility dates and permissions. The new module's ID can be saved in a token so later actions can work with it.
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
- Add a module to a page you just made with Create Page
- Build a set of pages from a template, for example one HTML module per customer page
- Add a module and then fill it with Update HTML Module or Import Module Content
Don't use it to
- Place a module that already exists on another page. Use Add Existing Module instead.
- Change a module that's already on the page. Use Update Module instead.
Related Actions
| Action Name | Description |
|---|---|
| Add Existing Module | Adds a shared instance or a copy of an existing module to a page. |
| Update Module | Changes a module's title, display options, dates and permissions. |
| Load Module | Reads a module's settings into tokens. |
| Delete Module (Soft) | Sends a module to the Recycle Bin. |
| Delete Module (Hard) | Deletes a module permanently. |
| Create Page | Creates the page to add the module to. |
| Update HTML Module | Sets the content of an HTML module. |
| Import Module Content | Imports content into a module. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Page | The page to add the module to. Pick a page, or use an expression that resolves to a Tab ID, a Tab Path such as //Customers//Acme, or a Tab Name (the first page with that name is used). Leave empty to use the current page. | Yes | Current page | No |
| Module Type | The type of module to create. Pick one from the list (this saves the desktop module ID), or use an expression that resolves to a desktop module ID or a friendly name, for example HTML. A friendly name is matched against module definitions first, then against desktop modules. | Yes | empty string | Yes |
| Module Title | The title of the new module. If empty, the action doesn't set a title. | Yes | empty string | No |
| Pane | The name of the skin pane to place the module in, for example ContentPane. Use a pane that exists in the page's skin. | Yes | ContentPane | No |
| Display Container | An expression evaluated as a boolean, for example true or [ShowTitle]. Sets the module's DNN Display Title option. Leave empty to keep DNN's default. | Yes (expression) | empty string | No |
| Enable Print | An expression evaluated as a boolean. Shows or hides the module's print option. Leave empty to keep DNN's default. | Yes (expression) | empty string | No |
| Enable RSS | An expression evaluated as a boolean. Turns the module's syndication (RSS) option on or off. Leave empty to keep DNN's default. | Yes (expression) | empty string | No |
| Start Date | The date the module becomes visible, for example 2026-10-01. Values that can't be parsed as a date are ignored. | Yes | empty string | No |
| End Date | The date the module stops being visible. Values that can't be parsed as a date are ignored. | Yes | empty string | No |
| Permissions | Rows of Permission Key and Role List. The key is VIEW or EDIT. The role list is role IDs or role names, separated by commas, semicolons or new lines, for example Registered Users;Editors. Use All Users or -1 for everyone and Unauthenticated Users or -3 for anonymous visitors. If you link to a Permission Grid field, you can use [PermissionGrid:PermissionName] tokens. | Yes (role list) | none | No |
| Store Module ID in | The name of a token to receive the new module's ID. For example, NewModuleId gives you [NewModuleId]. Leave empty if you don't need it. | No | empty string | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Store Module ID in | The token named here receives the new module's ID. |
Permissions
A new module starts with the page's permissions:
- View is set to "same as page", so whoever can see the page can see the module.
- Other page permissions, such as Edit, are copied to the module. Roles that can edit the page also get the module's own custom permissions.
Rows in Permissions then replace the permission of that kind:
- A
VIEWrow stops the module from inheriting the page's view permission and grants view only to the listed roles. - An
EDITrow removes the copied edit permissions and grants edit only to the listed roles. - Keys other than
VIEWandEDIT(or their permission names) are ignored. Roles that can't be found are skipped without an error.
Considerations
- The action needs a portal. It fails with
Can not add module without portal into contextwhen there's no portal, and withInvalid module definition ...when the module type can't be found. - Leaving Page empty needs a current page. In a scheduled workflow or an API call there's no current page, so the action fails with
Could not get current page. Pass a page instead. - Don't leave Module Type empty. When it's empty, no module is created. The action instead looks for an existing module on the page with an empty title and, if it finds one, applies the other settings to it.
- Keep the module ID. Load, Update and Delete Module find a module by ID or by title, and titles aren't unique, so they use the first match. Save the ID with Store Module ID in and use that.
- You can't set the position or container. The module is added to the pane in DNN's default position. Use Add Existing Module if you need to place a module at the top or bottom.
- There's no permission check in the action. Anyone who can run it can add modules to any page. Only run it where trusted users can reach it.
Examples
To understand how to use the below examples, please see Running Examples.
1. Add an HTML module to a new page
This action adds an HTML module titled Welcome to the page whose ID is in [NewPageId], and saves the module ID in [WelcomeModuleId].
{
"Title": "Add Module",
"ActionType": "AddModule",
"Description": "Add a welcome HTML module to the new page",
"Parameters": {
"PageId": "[NewPageId]",
"ModuleType": "HTML",
"Title": "Welcome",
"PaneName": "ContentPane",
"DisplayContainer": "true",
"StoreModuleId": "WelcomeModuleId"
}
}
2. Add a module that shows only during a campaign
This action adds an HTML module to the //Promotions page that's visible between the dates in [CampaignStart] and [CampaignEnd]. It only runs when the CampaignName token has a value.
{
"Title": "Add Module",
"ActionType": "AddModule",
"Description": "Add a campaign module with visibility dates",
"Condition": "[CampaignName] != \"\"",
"Parameters": {
"PageId": "//Promotions",
"ModuleType": "HTML",
"Title": "[CampaignName]",
"PaneName": "ContentPane",
"DateStart": "[CampaignStart]",
"DateEnd": "[CampaignEnd]",
"StoreModuleId": "CampaignModuleId"
}
}
Revised 09/27/2026