Share feedback, ideas and get community help

Updated last month

How to store complex JSON content in a variable

Can someone please give an example of how to do this with the result of an http request?

"If you really need to save a complex content into a variable, for example an object, you can use the JSON.stringify function to convert it into a text. And whenever you are using the variable, you can dynamically parse it back into an object using JSON.parse in an inline format:"

For example, I'm calling a GET from an API, which returns a JSON block of data. I would like to store all of it in a variable, so I can work with it - probably through a script block - and pull out the data I want. I'm not sure how to store the data in the variable correctly. When I try to save some portion of the data to a variable, and then return the variable, it comes back as undefined.
B
1 comment
Why don’t you save part of it in several variables? This is what I recommend with typebot
Add a reply
Sign up and join the conversation on Discord