Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Script bot response control

Use the Script bot response control in a Virtual Agent topic to run a script that returns a single response or a multi-part response.

Use the Script bot response control when creating a more complex response that relies on scripted calculations or requires a multi-part response. Scripted output can include text, image, cards, links, and HTML to create a versatile response.

Script bot response control properties

PropertyDescription
Node nameThe name that identifies this Script bot response control node in the topic flow.
Script output typeThe type of output returned by the script, either single-part or multi-part.
Script response messageThe script that generates the selected output type.
Advanced
Hide this node
Conditionally show this node ifNo-code condition statement or low-code script that specifies a condition for presenting this node in the conversation. The condition must evaluate to true.

Channel support

ChannelSupportConstraints
Web UISupportedNone
Mobile UISupportedNone
Now Assist panelNot supportedNot applicable
Microsoft TeamsSupportedNone
SlackSupportedNone
WorkplaceSupportedNone
Facebook MessengerNot supportedNot applicable
SMS TwilioNot supportedNot applicable
LINENot supportedNot applicable
WhatsAppNot supportedNot applicable
Apple Messages for BusinessNot supportedNot applicable
Alexa (Voice)Partial supportSupport depends on the type of response. For example, images and links may only be available on devices with screens. For details, see Fine-tune Virtual Agent settings and topics for the best Alexa voice chat experience.

Example script

In this example, the script calculates the time two hours from the current time and outputs a multi-part message that includes this information.

(function execute() {
      var gdt = new GlideDateTime();
      var gt = new GlideTime();
      gdt.addSeconds(7200);
      gt = gdt.getTime();
      var multiOutMsg = new sn_cs.MultiPartOutMsg();
      multiOutMsg.addPlainTextPart('Thank you for submitting an incident.');
      multiOutMsg.addPlainTextPart('You should receive a response from a technician by ' + gt.getByFormat('HH:mm'));
      return multiOutMsg;
})()

Example Script bot response control

Note: Virtual Agent Designer controls may display and function differently in other channels.

Script propertiesScript bot response output
Image omitted: va-script-output-properties.png
Basic properties include the node name, script output type, and the script itself.
Image omitted: va-script-output-web.png
A sample script output in a chat window that reads, "This is my script output."

Parent Topic:Assistant Designer bot responses