Javascript

The JavaScript widget allows users to create custom code inside a flow. This is useful especially when some variables calculations or manipulations are required. Examples of this can be setting a destination number with a specific format like with a plus icon or in an international format.

๐Ÿ“˜

Note

The code should be set on Javascript format. There is a button called Validate which will help you to check if the code placed is in the right format.

Parameters

ParameterDescription
Input DataIn this field you can add what are the variables that are gonna be considered as inputs of the script in JS format.Example: {
"number":"{{number}}"
}
Script codeJS code that will execute the desire action in the widget. Example: var result = {};
if(number && number.length > 0 && number.charAt(0) != "+") {
number = "+"+number;
}
result.number = number;
result
Name Of the variableUse this field in case you want to branch the flow based on the value of a variable used in the JS script.