Oliver Chapple

Bossman
I'm the CEO of Webdadi and love fiddling with tech

How do you pass a Code block javascript variable to the Conditions block?

Hi people,
I'm wondering how to set a landbot block variable value from within a javascript and also wondering how i output a variable from a script to pass into the landbot Conditions block.

Let's say I want to run a script that should generate a true or false.

How do I then set the Conditions variable from my true or false evaluation?

here's the script...

var expression = /(https?:\/\/(.+?\.)?awebsitedomain\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/g;
var regex = new RegExp(expression);

var t = '@{visitor_login_url}'; //my landbot block variable
console.log(t);

if (t.match(regex)) {
  console.log("Successful match");

//what should go here if I want the outcome true to be passed to the @isvalid Conditions block

  console.log("@{isvalid}"); //my Conditions block String variable

} else {
  console.log("No match");

//what should go here if I want the outcome false to be passed to the @isvalid Conditions block

  console.log("@{isvalid}");
}

Many thanks.
Oliver

Some trouble with using Design Settings after duplicating v1 bot to v3

Not sure if its my machine, but when trying to set options like Gradient and Header colours, having converted a V1 Bot to a V3 Bot, I'm unable to change the background settings like gradient and colours. When clicking gradient nothing happens and when trying to change the colours they immediately revert to what's there.
Anyway I love Landbot so am doing some experimenting. I've even managed to make Calendly popup without a modal window using your javascript code with a hackaround. Nice!