Skip to content

Access Custom Data in Agent AI Bot

Custom data refers to additional information, such as agent name, ID, and other metadata, that can be passed from third-party applications to enhance the functionality of the Agent AI widget. Agent AI accesses and utilizes this data to customize interactions, streamline processes, and provide more context-specific responses. Using custom data, you can improve user experiences and enable more dynamic workflows within the system.

Custom data appears as {{context.session.UserContext.customData.<key>}}.You can access it in the Welcome Event section and Automation page. The UserContext variable stores this data, and it is accessible wherever the UserContext variable is available.

Welcome Event

To access custom data in the Welcome Event section, follow these steps:

  1. Sign in to XO11.
  2. Click an app name on the App list.
  3. Click Agent AI > Configurations > Welcome Events.
  4. Click to expand the Configure Greeting Messages section on the Welcome Event page.
    configure-greeting-messages
  5. Click the edit button against a message where you want to access custom data. (If you don’t have any greeting messages, add a new one by following the Welcome Event doc.)
  6. Access your custom data in the Message field, as highlighted in the following screenshot:
    edit-welcome-message

Dialog Tasks

To access custom data in the Dialog Tasks section, follow these steps:

  1. Sign in to XO11.
  2. Click an app name on the App list.
  3. Click Automation AI > Virtual Assistant.
  4. Click an existing Dialog in the Dialogs page. (If you don’t have any Dialog, create a dialog by following this doc.)
  5. Click to open a Message node.
  6. On the Component Properties page, go to the User Prompts or Error Prompts field.
  7. Select Text or </> Custom JavaScript, as highlighted in the following screenshot:
    component-properties