Share feedback, ideas and get community help

Updated 2 months ago

Super basic question... Adding the value of two variables?

Hey, newbie over here, first question ever asked. I know this is an extremely basic question, but I really don't know how to do it and already read pretty much all the documentation 🀷🏻

--> If I have two variables A and B, already collected in the bot, and both are numbers... How can I add them?

I've tried setting a variable with several options (using {{= ... =}} and inline functions, preppending a "+" to the variable name, of course the basic A+B... but none of them worked when I tried to put the result in a bubble
M
K
4 comments
HI,
Please explain what do you mean with "add them"

If you have collected variable {{Number1}} --> f.e. 10 and variable {{Number2}} f.e. 20 and you need to have the result of addition (10+20=30) you only need to add, in your flow, a variable blok on that to use the formula ({{Number 1}}+{{Number 2}}) assigning them a variable (look like that you wan f.e. {{ADDITION}}) and, in the result to show the result variable {{ADDITION}}.

you can see my test flow in screenshot or you can see here https://app.typebot.io/typebots/cm2gbe78l0002f8m0t7y332jq/edit or download the json attached so to see better the simple flow.

i hope to have understood your question
Attachment
image.png
Thanks, that answered the question (adding them meant exactly that A=1 and B= 2 => A+B=3).
I told you it's was an extremely basic question, but was exactly was I was looking for. Actually, that helped me to understand that If any variable is not initialized, adding it to another one that has been initialized equals null (I know, quite basic again, but quickly ramping up over here).
Ok perfect.
really happy to have helped you.
Add a reply
Sign up and join the conversation on Discord