Need to use welcome task entity into other task

Suppose I have a welcome task in which there is entity popup_capture


and we have made the user input of that entity as an utterance which will identify the task we have made.

so we need to use the popup_capture entity value in other task , how can we use the value.

Hi @awasthividhu,

You can create and use “BotUserSession” variable to access data of one task into another task. This variable is specific to bot , user and for that session.

For example, I have a BookFlight task in which the user would provide the source and destination as input through entity nodes.

If I have to use the destination value given to the entity node in another task(say book cab), then

  • Create a script node after the destination entity node.
  • Define script to push the destination entity value into the BotUserSession variable in the script node.

BotUserSession.put(‘flightDestination’, context.entities.destinationName);

Here, flightDestination is the variable name that I am creating and destinationName is the entity node name.

image

Once the entity node is executed, you will be able to observe this variable under session & context variables >> BotUserSession in the debug console.

image

You can access this value across all the tasks using the following snippet:

{{context.session.BotUserSession.flightDestination}}

Let us know if you need any further information.

Regards,
Yoga Ramya.

Hi,
As we have given preference to intent over entity in popup_capture . So the the control is not reaching the script node attached next to it.

Hi @awasthividhu,

If you would like to use the entity value across tasks, you will be able to achieve it only by pushing the value to script while in that dialog.

Instead of choosing “intent over entity”, you can make transitions based on the entity value to necessary dialog by creating respective dialog nodes after executing the script node.

Regards,
Yoga Ramya.