Action: Run script May 30, 2022 16:30 Updated Index: Defining input variables Creating a JavaScript script How to save the return The action of executing a script allows greater flexibility and dynamism when creating a flow of conversation. Through it, it’s possible to create logics, treat variables and values, build dynamic content and many other options. Defining input variables It is possible to pass variables as input parameters to the script. They can be system, predefined, or those created by you. The variables will be treated in the script in the same order as they are passed in the Action. For that, it is necessary to select (or type) all the desired variables in the corresponding field. Creating a JavaScript script Blip allows the creation of a JavaScript ES5 script, with the possibility of up to 1000 operations per script. It will have the following structure: function run(inputVariable1, inputVariable2) { return "Hello Blip"; } The run function will be executed as the main one. The inputVariableX parameters are the variables defined as input variables and the return is what will be sent to the variable defined as the return. Comments: All input variables must be passed as function parameters; Objects received as a parameter must be transformed into a JSON object. Ex: JSON.parse (inputVariable1); Returned objects must be transformed into a string. Ex: JSON.stringify (inputVariable1). How to save the return After executing the script, it may be interesting to save the return in some variable, so that it can be used in your conversational flow. To do this, just define a name for the variable. For more information, access the discussion on the subject in our community or the videos on our channel. 😃 Related articles Builder variables Action: HTTP request Action: Process Command How to Set Up Business Hours Using a Script Sending WhatsApp Active Messages on Blip Desk