How to assign value in script node access value prompt message node

how to assign value in script node access value prompt message node in smart assist

Hi Amita,

Please follow the below steps to assign a value in the script and then access that value in the message prompt:

  1. In the script node, assign a value to the variable in the below format so that the assigned value will be stored in the context object later you can access in the message prompt.
context.{{variable_name}} = {{value}};

Example:
context.value = 10;

Attaching the screenshot for your reference:

  1. In the message prompt you can access the value using the below script:
{{JSON.stringify(context.value)}}

With this you can display the value.

Attaching the screenshot for your reference:

1 Like