PrefilledVariables in buttons
Hi Typebot family.
I added a Typebot bubble to my website. Works great, but now I want to add a separate button with a variable prefilled.
How do I prefill a variable in the button below?
<button onclick="Typebot.open()">Contact us</button>
Full code please, I'm a noob.
4 Replies
Have you checked the prefilledVariables option?
https://docs.typebot.io/embed/html-javascript#additional-configuration
You'd just have to add it to your init code
HTML & Javascript | Typebot docs
Standard
I did, @Baptiste. For prefilling variables to URL and embedding code, it's clear. But I want to have different buttons on my websites that open the same Typebot. And each button automatically fills in different variables. Is there a way to do it?
Sure! Something like this should work:
Works like a charm!
Thank you, @Baptiste