execute code workflow variable not updating
# 🤝help
d
Hi All, I'm new to botpress, so apologies if this is something obvious. I have a workflow string variable which I assign a value using a execute code (API) the value comesup nicely within the console.log but for whatever the reason it won't get updated within the workflow variable outside the code block. axios .request(config) .then((response) => { const jsondata = response.data console.log(workflow.candidateResponse) const fullname = jsondata.results[1].full_name.toString() workflow.candidateResponse = fullname console.log(workflow.candidateResponse) return workflow.candidateResponse }) .catch((error) => { console.log(error) }) Any idea what is causing this? I want to access workflow.candidateResponse using a standard text card.
a
hey @damp-air-33855 you will need to add an
await
at the start of this so that Botpress doesn't move on before it is completed
d
Thanks @acceptable-kangaroo-64719 that worked like a charm. Such a small thing to miss. Thanks again. you are a star
a
no problem! Good luck with your bot 🚀
13 Views