The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there any documentation on the sn_cs.MultiPartOutMsg() API used within Virtual Agent script?

Eric DeBolt
Kilo Expert

When using 'Script Output' bot response within Virtual Agent designer it references a SN_CS API, suggesting there is more information available on how to use the script output for multi-part outputs.  However, I was unable to locate any references to this and no documentation is available.

I am primarily trying to understand how to use the script output to send a multi-part message that includes HTML. The example provided in the comments shows how to create one with plain text only.

 

 find_real_file.png

2 REPLIES 2

siva_
Giga Guru

Hello Eric, 

Even i have the same query i am waiting from a long time if servicenow can update the missing info on the docs website, Lets hope it can be done soon , As of now i was not able to find any info on the API used here. Would wait equally with you if any one on the community have the solution for the same

 

Thanks,

Siva

 

Eric DeBolt
Kilo Expert

I never got a reply to this but I was able to figure out how to script the different available outputs.

 

Example code below:

var multiOutMsg = new sn_cs.MultiPartOutMsg();
       multiOutMsg.setNavigationLabel('Click for More');
       multiOutMsg.addImagePart('https://community.servicenow.com/3726056fdb72af409540e15b8a961977.iix');
       multiOutMsg.addHtmlPart('<p>test</p>');
       multiOutMsg.addLinkPart('This is the link header', 'Displayed Text', 'https://www.google.com');
       multiOutMsg.addPlainTextPart('test');
       return multiOutMsg;
  • 'setNavigationLabel' is  the text displayed on the button that the user will click to view the next output
  • 'addImagePart' is how you can script output an image. Provide the url to the image you want to display.
  • 'addHtmlPart' is how you can script an output that uses html markup.
  • 'addLinkPart' is how you can script an output that provides a link to the user.  The first parameter is the header displayed in the message window, the second parameter is the label displayed for the link, and the last parameter is the URL.
  • 'addPlainTextPart' is the default script that outputs plain text.

 

find_real_file.png