About Entity Pre-Assignments
You can pre-populate data for the destination dialog task by:
- Adding values to the entity keys.
- Adding additional custom keys and values to pass data from the current dialog task
Context
object to the destination dialog task as needed.
By default, entity nodes defined in the target dialog task are displayed as key/value pairs. You can then define values for associated entities or add custom keys and values as needed using session and context variables.
Transitioning from the source dialog task to the destination dialog task occurs at the runtime when the user input matches one of any linked dialog tasks. When you map more than one dialog task, you can define which dialog tasks are displayed to the end-users using conditional transitions.
When you call another dialog task, you want to carry information from the first dialog task to the next dialog task. For example, customer information collected in a Book a Flight dialog task is passed to the Book a Hotel dialog task.
In the Bots platform, you can use the mappedIntents
variable in the Context
object which holds the reference of the intent nodes as well as the context of the source dialog task as shown in the following JSON syntax:
{ 'title': 'title of the link', 'link':' url for the link' ,'postbackpayload': 'system generated payload'}
For example, a link to GetEmail
in the Context
object can be:
{
"title":"GetEmail",
"link":"https://app.collab.ai/wf/1.1/market/users/bots/st-bb1eb3da-cfa7-5244-b241-b5042d333e76/dialogue/dg-15fd2927-219c-5795-b038-5b830718bea7/execute?nodeId=message2&contextId=dcx-f9bae173-4d69-53e4-9aa7-21e89aae776d&intent=GetEmail",
"postbackpayload":"MappedDialog_dc-f7b42932-dc06-53ac-92c0-1db706794f91_dg-15fd2927-219c-5795-b038-5b830718bea7_dcx-f9bae173-4d69-53e4-9aa7-21e89aae776d"
}
You can access and present these variables in a prompt message to a user to display a list of mapped dialog tasks with the link, or as a list of choices. You can pass the source dialog context to the target dialog task even if the source dialog task is no longer actively using the Context
object.
The value for the postbackpayload
key is generated by the Bots platform and is used in some channels, such as Facebook and Slack, which defines when a link or choice is made for a target dialog task.
For more information, refer to Using Session and Context Variables in Tasks and the Context Object.