This section describes how to utilise JavaScript in Viabl.ai (written in the standard JavaScript language) together with a number of special Viabl.ai constructs.
Viabl.ai allows the developer to write custom scripts using the JavaScript language to perform calculations and implement data manipulation algorithms at runtime. Scripts can either be contained in re-usable Object Scripts or be embedded directly within Decision Trees using Add Scripting (JavaScript) Built Tool. Scripts can also embedded inside then Events of some Viabl Platform Objects.
In additions to the standard JavaScript language syntax, Viabl.ai supports the following special constructs:
Use the # prefix to access Viabl.ai runtime Object values and Viabl.ai Object methods & properties in your JavaScript code.
Additional specialised Viabl.aifunctionality can be accessed using the following:
To use a Viabl.ai Object in the JavaScript editor, you can drag & drop the Object from the Available Objects panel, on the right hand side, instead of typing the Object Name.
Pressing the CRTL-SPACE keys, after the dot in #ObjectName. and xpertrule. will show the full list of available properties and methods for this Object.
There are a number of keystroke shortcuts available in the editor...