Share feedback, ideas and get community help

Updated 6 months ago

Get data from a text

At a glance

The community member has created a code that sends them all the customer data in the flow, and they are trying to make a script to take this data and put it in variables, but they are not succeeding. The comments suggest that the fullTicket variable is taking the data and throwing it into the text provided as an example, and the community member is trying to make a script to take the data from the text and put it in variables, but it is not working.

One of the community members suggests that the fullTicket variable may have been created during the flow or generated alongside the client. They also mention that according to the documentation, the setVariable function is only available in scripts executed on the server, so it won't work if the "Execute on client?" option is checked. They recommend using a variable block to define fullTicket by checking to run on the client side, and then using a script block running the setVariable on the server side. They also suggest remembering to always use JSON parse, since the variables in Typebot will always be converted to text or a list of texts before being saved in the database.

Hello everything is fine ? I have a question, I made a code, where it sends me all the customer data in the flow,
example: id":9051,"name":"teste ","number":"999999999","email":" ","","pushname":"test".
However, I'm trying to make a script to take this data and put it in variables, but I'm not succeeding, can someone more experienced help?
D
!
3 comments
the fullticket variable is what is taking the data and throwing it into this text that I gave as an example, I am trying to make this script to take the data from the text and put it in variables, but it is not working
Is fullTicket created during the flow or is it generated alongside the client?

According to the documentation: "The setVariable function is only available in script executed on the server, so it won’t work if the Execute on client? is checked."

Considering that it is already a variable defined on the client side:
I would recommend using the following solution:

  • use a variable block to define fullTicket by checking to run on the client side
  • now use the script block running the setVariable on the server side.
Considering that it is already a variable defined during the flow, the only thing I would remove would be the first step I mentioned and remember to always use json parse, since the variables in typebot will always be converted to a text or a list of texts before the variable is saved in the database.

Example flow:
Add a reply
Sign up and join the conversation on Discord