The Agent AI widget receives agent name, ID, and other metadata in the form of custom data, if it is passed from the third-party applications. You can access custom data in the Welcome Event section of the Agent AI > Configuration page and in the Dialog Tasks section of the Agent AI > Automation page. Custom data is available in the UserContext variable, and wherever you can access UserContext variable, you can access custom data.
Custom Data can be accessed as
{{context.session.UserContext.customData.<key>}}
Welcome Event
To access custom data in the Welcome Event section, follow these steps:
- Sign in to Agent AI.
- Click Configuration > Experiences > Welcome Event.
- Click to expand the Configure Greeting Messages section in the Welcome Event page.
- 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 message by following the Welcome Event doc.)
- Access your custom data in the Message field, as highlighted in the following screenshot:
Dialog Tasks
To access custom data in the Dialog Tasks section, follow these steps:
- Sign in to Agent AI.
- Click the Automations tab, and click an existing bot.
- Click to expand the Conversational Skills field under Build.
- Click Dialog Tasks.
- Click an existing Dialog Task. (If you don’t have Dialog Tasks, create a dialog task by following this doc.)
- Click to open a Message node.
- Click MANAGE RESPONSES.
- Click to expand the message.
- Access the custom data in the Message field, as highlighted in the following screenshot: