Logic
Script block
The “Script” block allows you to execute Javascript code.
This block doesn’t allow you to create a custom visual block
Variables in script are not parsed, they are evaluated. So it should be treated as if it were real javascript variables.
You need to write console.log({{My variable}})
instead of console.log("{{My variable}}")
setVariable
function
If you want to set a variable value with Javascript, the Set variable block is more appropriate for most cases.
However, if you’d like to set variables with the script blocks, you can use the setVariable
function in your script:
The setVariable
function is only available in script executed on the server, so it won’t work if the Execute on client?
is checked.
Examples
Reload page
Redirect if a variable has a specific value
Do you need to do something but you’re not sure how to? Join the Discord server and get instant help!