Javascript - Functions Widget
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
Parameter | Description |
---|---|
Input Data | In 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 code | JS 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 variable | Use this field in case you want to branch the flow based on the value of a variable used in the JS script. |
Updated 11 months ago