Output a variable with the script block
Is it possible to have a script in the script block to generate a variable as an output?
Also... Do you have any tutorials on the script block? I could only find one.
5 Replies
What do you mean with " to generate a variable as an output?"
have you already seen https://docs.typebot.io/editor/blocks/logic/script
here you can read (i think) what you search -->
https://docs.typebot.io/faq#can-i-set-a-variable-with-the-script-block:~:text=No%2C%20the%20script%20block%20is%20only%20meant%20to%20execute%20a%20script.%20You%20can%27t%20set%20a%20variable%20with/in%20it.%20If%20you%20need%20to%20set%20a%20variable%20with%20some%20code%2C%20you%20can%20use%20the%20Set%20variable%20block.
Script block | Typebot docs
The "Script" block allows you to execute Javascript code. If you want to set a variable value with Javascript, use the Set variable block instead. You can't set a variable with the script block.
FAQ | Typebot docs
Why some of my results are empty?
Check out the Set variable block @EpicFace (https://docs.typebot.io/editor/blocks/logic/set-variable)
Set variable | Typebot docs
The "Set variable" block allows you to set a particular value to a variable.
Hi yeah I figured it out... Thanks
I'm wondering how I can improve this because it's a commonly asked questions from new users 🤔