Set Node returns json

My set node is returning a json formated response to the chat node like this:
{ “response”: “You have these three options:\na) option 1\nb) option 2\nc) option 3” }

I want it to respond like this:
You have these three options:
a) option 1
b) option 2
c) option 3

I’m not sure if this is the best way to do what I want, so I’m open for suggestions. When I use an agent on the “No category” leg, I can get what I want, but that seems like overkill since I have an exact response. No need for a brain on this one.

If you’re looking for correct line-breaks, you would want to return the plain-text representation of obj['response'], not the object.


They’re both technically the same thing. \n denotes a line break.

If it was to actually perform the line-break, the JSON would be considered “malformed” and unreadable.

If you were to run the same line in something like python:

import json
data = json.loads('{ “response”: “You have these three options:\na) option 1\nb) option 2\nc) option 3” }')
print(data["response"])

You would get

You have these three options:
a) option 1
b) option 2
c) option 3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.