Topic Block utility
-
- UpdatedMay 20, 2024
- 4 minutes to read
- Vancouver
- Virtual Agent
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
For more information, see Add a reusable topic block to a calling topic or topic block.
Property | Description |
---|---|
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. |
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. |
Input mapping | The variables to be used as input to the selected topic block. For example, the following image has example variables: 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 ( |
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 ( |
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. |
Example Topic Block utilities
Using dynamic Topic Blocks
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 returnTwoFactorReset
, otherwise you returnNormalPasswordReset
. - Define two input mappings:
password
andtwoFactorToken
, both set equal to an object passed in which contains their values. - Define two output mappings:
successful
andtempPass
, 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.