I execute a API and save the response (a JSON) in a variable named "resultados". In the next script block I have a javascript to perform this json get some information saved in a variable "resultString ". how typebot save a variable as json object? As I read all variables are save as string. I tried with JSON.parse but continue with erro. How typebot indentify a json object. this code if I run in a JSFRiddle run successfully
example code: is a function with a typebot variable as parameter
function formatarAgendamentos(jsonData) { var resultado = "";
// Função para formatar a data function formatDate(date) { var d = new Date(date); var formattedDate = ("0" + d.getDate()).slice(-2) + "/" + ("0" + (d.getMonth() + 1)).slice(-2); var formattedHour = ("0" + d.getHours()).slice(-2) + ":" + ("0" + d.getMinutes()).slice(-2); return formattedDate + " " + formattedHour; } var numAgendamento = 1; // Percorrendo os médicos e seus agendamentos jsonData.data.h.forEach(function(medico) { resultado += medico.name + "\n";
more information the documentation explain: see picture: it is impossivel use {{=JSON.stringify({{MYvariable}})=}} in the HTTP request / save in variables / set variable. in this field only variable names accept