---
sourceDocument: Brazil Conversational Interfaces
sourceDocumentLink: https://www.servicenow.com/docs/r/conversational-interfaces

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Conversational Interfaces

ft:clusterId :

    - convint

bundleId :

    - convint

workflow :

    - Platform


---

# Topic Block utility

# Topic Block utility {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Topic Block utility

The Topic Block utility in Virtual Agent conversations enables you to execute specific functions or subflows within a calling topic by invoking reusable topic blocks.
This capability allows you to modularize and streamline conversation design by embedding predefined logic and workflows, improving maintainability and scalability of your Virtual Agent topics.
Show full answer Show less  

## Key Features

* **Node name:** Automatically assigned based on the selected topic block, or customizable when using dynamic Topic Blocks.
* **Use dynamic Topic Block toggle:** Activates dynamic options allowing programmatic selection of topic blocks and flexible input/output mappings.
* **Topic block selection:** Choose from a list of published topic blocks to add to your calling topic, or define conditions/scripts for dynamic selection.
* **Input mapping:** Map variables to provide inputs required by the selected topic block. When dynamic, inputs are manually managed, supporting strings, records, scripts, and more.
* **Output mapping:** Capture and handle variables returned by the topic block, with dynamic management similar to input mappings.
* **Advanced conditions:** Use no-code or low-code expressions to conditionally show or hide the Topic Block node in the conversation flow.

## Using Dynamic Topic Blocks

Dynamic Topic Blocks allow you to programmatically determine which topic block to invoke based on runtime conditions or scripts, enabling greater flexibility. This is especially useful when different processing logic or data inputs are needed depending on user input or context.

* You can define a script to decide the topic block name dynamically, such as selecting a troubleshooting topic based on a car make.
* Input and output mappings are manually configured to accommodate varying parameters, including optional outputs.
* Example use case: a single dynamic Topic Block handles both normal password resets and two-factor authentication resets by evaluating conditions and adjusting inputs/outputs accordingly.

## Practical Benefits for ServiceNow Customers

* Reuse existing conversation logic efficiently by embedding topic blocks within other topics.
* Reduce duplication and simplify updates by managing reusable components in one place.
* Increase conversational flexibility by dynamically selecting topic blocks based on user input or context.
* Enhance Virtual Agent design with conditional logic to tailor conversation paths and improve user experience.  
Use a Topic Block in a Virtual Agent conversation to
perform a specific function or subflow that runs certain steps in a calling topic.

## Topic Block utility properties {#va-topic-blocks__section_xwb_mgn_pdb}

For more information, see [Add a reusable topic block to a calling topic or topic block](https://www.servicenow.com/docs/vF4UydsXfrtC0RozFOLx3Q "Add a reusable topic block to a calling (parent) topic or topic block to run a specific function or task in the calling topic. You specify input parameters used in the topic block, and you specify output parameters that are used by the calling topic.").  
{#va-topic-blocks__table_nff_y1b_3db__entry__2}

| Property | Description |
|-|-|
| Node name | Name of the topic block node. The name is automatically assigned based on the topic block that you select. For example, if you choose the Acme Contextual Search topic block, the Name is Acme Contextual Search. With Use dynamic Topic Block active, input a name of your choice. |
| Use dynamic Topic Block | Set this toggle to activate dynamic Topic Block options. |
| Topic block | A list of published topic blocks. Select a topic block to add to the calling topic. With Use dynamic Topic Block active, use the condition builder to input a condition or script instead. |
| Input mapping | The variables to be used as input to the selected topic block. In this example, input mapping variables include catalog item ID, execute contextual search, confirm catalog item, and show end state card. The contents of this area change according to the topic block you selected. Options may include string input, referenced records, scripts, and so forth. With Use dynamic Topic Block active, you add all input mappings manually instead by selecting the Manage inputs to define icon ![Manage inputs to define icon.](). Inputs are handled similarly to the Input Parameters dialog box in the Start segment of a [reusable topic block](https://www.servicenow.com/docs/k6pzIGSQ_xsw8mBhD~cAmw "Build a reusable component that performs a specific subflow of tasks and conversational elements in Virtual Agent conversations."). |
| Output mapping | The variables to be output by the selected topic block. For example, the following image has example variables that are enabled: The contents of this area change according to the topic block you selected. With Use dynamic Topic Block active, you add all input mappings manually instead by selecting the Manage outputs to define icon ![Manage outputs to define icon.](). Inputs are handled similarly to the Input Parameters dialog box in the Start segment of a reusable topic block. |
| Advanced ||
| Hide this node ||
| Conditionally use this node if | A no-code condition statement or low-code script that specifies a condition for presenting this node in the conversation. The condition must evaluate to true. |
[ ]

{#va-topic-blocks__table_nff_y1b_3db}

## Example Topic Block utilities {#va-topic-blocks__section_jxd_nh5_tdb}

The following Topic Block utility properties include the reference to an available topic block, input mapping variables to the topic block, and the output variables that the topic block will pass.

The following Topic Block utility properties have the Use dynamic Topic Block toggle switch turned on.

<br />

## Using dynamic Topic Blocks {#va-topic-blocks__section_p1r_ytb_jbc}

Toggling the dynamic setting on the Topic Block enables you to programmatically choose which topic block or blocks to invoke, based on any number of conditions. You can pass in a dynamic set of inputs without an explicit, one-to-one match for a Topic Block definition.

For example, assume you have two Topic Blocks. One sets your password by taking your username and returning a success or fail message. The other resets your password, but requires that you send two-factor authentication (2FA) token with the request before returning a success or fail message and a temporary password.

You can create two separate Topic Block invocations to handle the password-reset procedure, or you can create one Topic Block with the dynamic setting active and defined as follows:  
* Add a script that checks if the reset type is `includesTwoFactor = true`. If the statement evaluates to true, then you return `TwoFactorReset`, otherwise you return `NormalPasswordReset`.
* Define two input mappings: `password` and `twoFactorToken`, both set equal to an object passed in which contains their values.
* Define two output mappings: `successful` and `tempPass`, the latter of which is only set if it exists in the return value for the Topic Block.
* Define two output nodes to output success or failure, and an output to confirm to you whether the `tempPass` value is true.
{#va-topic-blocks__ul_z5h_w5b_jbc}

## Example dynamic Topic Block expression {#va-topic-blocks__section_b5f_zs1_jbc}

    (function execute() {
        /* Return the name of the topic block to run. For example:
            switch (vaVars.car_make) {
                case 'Ford':
                    return 'Ford troubleshooting';
                case 'Toyota':
                    return 'Toyota troubleshooting';
                default:
                    return 'General car troubleshooting';
            }
        */
    })()

The script in the dynamic Topic Block expression returns a value based on your input. In this example, if you input <kbd class="ph userinput">Ford</kbd> or <kbd class="ph userinput">Toyota</kbd>, the Virtual Agent will call for the appropriate troubleshooting topic. If you input any other value, the Virtual Agent returns a general troubleshooting topic instead.

