Skip to content

Script#

Executes a script. This step is helpful to retrieve information, perform transformations or execute actions in the system. This step requires more advanced knowledge from the scenario builder.

Name Description Mandatory Type Possible Values Default Value
script Script to execute. When a string, it is expected to be encoded in Base64. When a string array, it is expected to be the code, one line per position of the array Y String, String[]

Available Scope#

Property Description Type
answers List of all answers provided by the user so far. The script has full access to the list, allowing it to read, change, add or remove answers Object
stepDefinition Representation of the step where the script is executing. Cannot be changed. BusinessScenarioStep
lboUtilities A set of utilities available to use to manipulate or invoke the light business objects. LBOUtilities
iotUtilities A set of utilities available to use to manipulate or invoke the light business objects. IoTUtilities
masterdataDirector A set of utilities available to use to create masterdata objects. MasterDataDirector
workflowBuilder A set of utilities available to use to create workflow objects. WorkflowBuilder

Info

Information for the scope types for this step is available from the navigation menu on the left.

Example snippets#

{
    "type": "Script",
    "settings": {
        "script": [
            "console.log('Hello World');",
            "// Dump all previous answers",
            "console.log(this.answers);",
            "this.answers.newAnswer = 'new Value';",
        ]
    },
    "next": "NextStep"
}
{
    "type": "Script",
    "settings": {
        "script": "Y29uc29sZS5sb2coJ0hlbGxvIFdvcmxkJyk7Ci8vIER1bXAgYWxsIHByZXZpb3VzIGFuc3dlcnMKY29uc29sZS5sb2codGhpcy5hbnN3ZXJzKTsKdGhpcy5hbnN3ZXJzLm5ld0Fuc3dlciA9ICduZXcgVmFsdWUnOw=="
    },
    "next": "NextStep"
}