Builder blocks
Code block
8 min
for landbot (web) to see how to deal with landbot variables and javascript variables, please check this https //help landbot io/article/9kt26mmub4 landbot variables javascript variables learn how to use our block type code, it lets you easily add javascript code within a block! sometimes we want to trigger some javascript functions during the flow, here is where we can do it the code in these blocks will be active only when the visitor passes through this point so functions in the block don't have a global scope warning the url must be an https //la/ otherwise you will get an error that will not allow you to save changes how to use the code block this code will be embedded inside \<script> \</script> tags, so there is no need to add them, as you can see below in this example, when the visitor passes through this block, a "hello world" will be printed in the console code block and add js (custom scripts) and css code in the add js section, are global, as soon as the footer of the bot is loaded on the web, it is ready to use this is the place to set up, "global" functions and variables with global scope even if they are placed in different sections, code can communicate easily as you can see below using the code blocks to trigger the global limitations a google sheet integration block cannot be located after a code block is not possible to test or use the code block on the sandbox plan for whatsapp for a list of all the blocks and current functionalities with whatsapp bots, please check https //help landbot io/article/3hfm48i31y this block/functionality is not compatible with whatsapp for facebook messenger this block/functionality is not compatible with messenger