Scripting functions are modules of code that you can use to accomplish a certain task programmatically. They let you:

  • Extend the capabilities of your bots by writing custom JavaScript code
  • Perform complex operations, manipulate data, and integrate with external services

With few exceptions, the functions can be used in the following JavaScript code panels in interactions:

  • Pre-Process Code
  • Post-Process Code
  • Process User Response

For info on the order of operations (i.e., which code is run when), see this section.

Requirements

See the requirements.

Important notes

  • Function names are case-sensitive in the JavaScript.
  • Functions require the botContext. prefix.
  • Functions are scoped ONLY for the JavaScript panel in which they appear.