Share feedback, ideas and get community help

Updated 4 months ago

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
B
o
W
10 comments
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
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?
its there on script as well
Attachment
image.png
keep this off to execute on server
Version: 2.18.4
maybe you need to upgrade then
Oh right, please upgrade
Add a reply
Sign up and join the conversation on Discord