How to get user info from context to display on Smartassist Agent console

Here are the sample steps in which the bot asks for the user details like first name, last name, email, and ID and displays these details while transferring to an agent.

  1. In the dialog task, we have 4 entity nodes that ask the user for first name, last name, email, and ID details. After the entity nodes add the below script in the script node in the bot action node which is used to store the entity details in the context object.




  1. Now in the agent transfer task in the automation bot, before the agent transfer node add the message prompt, and in the advanced mode, add the below utils script to set the user info.

Advanced JS script:

var userType = [
"firstName": context.session.UserSession.fName,  //context path of the first name
"lastName": context.session.UserSession.lName,  //context path of the last name
"email":,  //context path of the email
"ID":  //context path of the id


  1. After configuring the two steps publish the automation bot.

Here is the sample example for your reference:

Bot asked for the user details in the dialog task and then while transferring to an agent the user info is set instead of anonyms.

@praveen.adari’s Sowjanyam.