T
Typebot•9mo ago
ooshy

Return string from async function in script logic node

Hi @Baptiste in a script node I have console.log('postAgentMessageToUser content:', content); and i can see the string that exists within 'content' in the console. I want to display this string back to the user as a typebot message but not sure how to do so. I've tried to set variables within the script node and using a set variable node but haven't gotten anything to work. Any help appreciated
8 Replies
Baptiste
Baptiste•9mo ago
setVariable is the way 🙂 if you think there is a bug: Describe it like this: 1. Steps to reproduce 2. What's happening 3. What were you expecting
ooshy
ooshyOP•9mo ago
Thanks for your answer @Baptiste I have tried this at the bottom of my script node: console.log('CONTENT', agent_response); return agent_response; setVariable("Assistant Messages", agent_response); In console i can see there is a string in the agent_response. But when i try and display {{Assistant Messages}} in the following text bubble node it is empty. I can see in the docs thatthe setVariable will only work when executed on the server but i can't see any settings available for this directly on the script node?
William
William•9mo ago
its there on script as well
No description
William
William•9mo ago
keep this off to execute on server
ooshy
ooshyOP•9mo ago
Version: 2.18.4
William
William•9mo ago
maybe you need to upgrade then
Baptiste
Baptiste•9mo ago
Oh right, please upgrade

Did you find this page helpful?