Sending script commands

Virtual assistants designed in Mix can trigger NDEP script commands via two reserved variables, ndepCommandName and ndepCommandPayload.

Overview of the workflow

In Mix.dialog, you must define a variable of type string with the name ndepCommandName to hold the name of the desired NDEP script command. If your virtual assistant will be using NDEP script commands that require a payload, define one more variable of type string with the name ndepCommandPayload.

In the components that will be triggering NDEP script commands, you’ll need to set these variables in the Enter node, and use them as Send parameters for the appropriate question and answer node.

Example use case: forced navigation

This scenario shows how to configure a question and answer node, to trigger the NDEP script command forcedURLNavigation that forces the end user’s browser to navigate to a specific URL.

  1. In Mix.dialog, select the Enter node of the component from which forced navigation is to happen.
  2. Add an assign action that sets ndepCommandName to forcedURLNavigation.
  3. Add an assign action that sets ndepCommandPayload to the desired URL—for example, to _self.
    Note that specifying “to _self” instructs the browser to open the URL in the current tab, instead of opening a new tab or window.
  4. Select the question and answer node from which forced navigation will be triggered.
  5. Define the desired initial message—for example, Please log in to continue. Did this answer your question?
  6. (Optional) Add a reentry message, if desired.
  7. Add Send parameters for ndepCommandName and ndepCommandPayload.