Share feedback, ideas and get community help

Updated 10 months ago

Declaration of variables

At a glance

A community member is having an issue with declaring variables in Typebot. They perform a database query to retrieve product categories, and then assign two variables: one to store a list of product codes and names, and another to store the number of items returned. The issue is that on the web, the flow works normally, but on WhatsApp, the user needs to send the response twice for the flow to continue on the second response. The community member has tried declaring the variable at the beginning of the flow and calling it in a script block, but they don't know how to assign the value obtained from the logic to the variable declared at the beginning.

In the comments, another community member requests a simple reproduction of the issue to help reproduce the bug.

Hello! Good evening, Typebot community! I am having a certain issue with the declaration of variables in Typebot. I perform a query on my database to retrieve the existing product categories, and right after that, I assign two variables: the first one to store a list with the codes and names of the products, and the other variable to store in an array the number of items that my database query returned (for validation purposes). The real problem: the flow executed on the web works normally, but on WhatsApp, when it gets to the part where these two variables are declared, the user needs to send the response twice for the flow to continue only on the second response. Could someone tell me why this happens? Note: I use this logic twice in my flow, and this issue only occurs in the first part, but not in the second. Attached is a photo of the declaration of my two variables.

I have already tried declaring the variable at the beginning of my flow and calling it at a certain part of the flow in a script block to perform the aforementioned logic, but I do not know how to assign the value (an array with the number of items from the database) obtained as a result of the logic to the variable I declared at the beginning of my flow. In other words, the result only works within the script block but is not recognized outside of this block.
B
2 comments
Can you provide a simple reproduction of the issue? I need a way to reproduce the bug
By DM if it is private.
Add a reply
Sign up and join the conversation on Discord