Skip to main content
Version: 1.28 (Current)

Add Module

Audience: Low-code Engineers

Skill 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.

note

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​

Don't use it to​

Action NameDescription
Add Existing ModuleAdds a shared instance or a copy of an existing module to a page.
Update ModuleChanges a module's title, display options, dates and permissions.
Load ModuleReads a module's settings into tokens.
Delete Module (Soft)Sends a module to the Recycle Bin.
Delete Module (Hard)Deletes a module permanently.
Create PageCreates the page to add the module to.
Update HTML ModuleSets the content of an HTML module.
Import Module ContentImports content into a module.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
PageThe 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.YesCurrent pageNo
Module TypeThe 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.Yesempty stringYes
Module TitleThe title of the new module. If empty, the action doesn't set a title.Yesempty stringNo
PaneThe name of the skin pane to place the module in, for example ContentPane. Use a pane that exists in the page's skin.YesContentPaneNo
Display ContainerAn 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 stringNo
Enable PrintAn expression evaluated as a boolean. Shows or hides the module's print option. Leave empty to keep DNN's default.Yes (expression)empty stringNo
Enable RSSAn 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 stringNo
Start DateThe date the module becomes visible, for example 2026-10-01. Values that can't be parsed as a date are ignored.Yesempty stringNo
End DateThe date the module stops being visible. Values that can't be parsed as a date are ignored.Yesempty stringNo
PermissionsRows 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)noneNo
Store Module ID inThe 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.Noempty stringNo

Output Parameters Reference​

ParameterDescription
Store Module ID inThe 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 VIEW row stops the module from inheriting the page's view permission and grants view only to the listed roles.
  • An EDIT row removes the copied edit permissions and grants edit only to the listed roles.
  • Keys other than VIEW and EDIT (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 context when there's no portal, and with Invalid 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​

tip

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