{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":5285,"path":"conversational-interfaces/virtual-agent/va-script-output.md","title":"Script bot response control","bundle":null,"doc_type":null,"release":"australia","body":"\n# Script bot response control\n\nUse the Script bot response control in a Virtual Agent topic to run a script that returns a single response or a multi-part response.\n\nUse 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.\n\n## Script bot response control properties\n\n<table id=\"table_l2x_5jn_vdb\"><thead><tr><th>\n\nProperty\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nNode name\n\n</td><td>\n\nThe name that identifies this Script bot response control node in the topic flow.\n\n</td></tr><tr><td>\n\nScript output type\n\n</td><td>\n\nThe type of output returned by the script, either single-part or multi-part.\n\n</td></tr><tr><td>\n\nScript response message\n\n</td><td>\n\nThe script that generates the selected output type.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nAdvanced\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nHide this node\n\n</td></tr><tr><td>\n\nConditionally show this node if\n\n</td><td>\n\nNo-code condition statement or low-code script that specifies a condition for presenting this node in the conversation. The condition must evaluate to true.\n\n</td></tr></tbody>\n</table>## Channel support\n\n|Channel|Support|Constraints|\n|-------|-------|-----------|\n|Web UI|Supported|None|\n|Mobile UI|Supported|None|\n|ServiceNow Otto panel|Not supported|Not applicable|\n|Microsoft Teams|Supported|None|\n|Slack|Supported|None|\n|Workplace|Supported|None|\n|Facebook Messenger|Not supported|Not applicable|\n|SMS Twilio|Not supported|Not applicable|\n|LINE|Not supported|Not applicable|\n|WhatsApp|Not supported|Not applicable|\n|Apple Messages for Business|Not supported|Not applicable|\n|Alexa \\(Voice\\)|Partial support|Support 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/va-settings-for-alexa.md).|\n\n## Example script\n\nIn this example, the script calculates the time two hours from the current time and outputs a multi-part message that includes this information.\n\n```\n(function execute() {\n      var gdt = new GlideDateTime();\n      var gt = new GlideTime();\n      gdt.addSeconds(7200);\n      gt = gdt.getTime();\n      var multiOutMsg = new sn_cs.MultiPartOutMsg();\n      multiOutMsg.addPlainTextPart('Thank you for submitting an incident.');\n      multiOutMsg.addPlainTextPart('You should receive a response from a technician by ' + gt.getByFormat('HH:mm'));\n      return multiOutMsg;\n})()\n```\n\n## Example Script bot response control\n\n**Note:** Asset library controls may display and function differently in other channels.\n\n<table id=\"table_f1f_v2p_xdb\"><thead><tr><th>\n\nScript properties\n\n</th><th>\n\nScript bot response output\n\n</th></tr></thead><tbody><tr><td>\n\n\\[Omitted image \"va-script-output-properties.png\"\\] Alt text: Basic properties include the node name, script output type, and the script itself.\n\n</td><td>\n\n\\[Omitted image \"va-script-output-web.png\"\\] Alt text: A sample script output in a chat window that reads, \"This is my script output.\"\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Assistant Designer bot responses](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/va-bot-responses.md)\n\n"}}