Hello,
I have a chat node connected to an IF node that splits between an Edit Field Node and an AI Agent. If a user asks any question with the word “price” in it, they are routed to the Edit Field Node where it responds “Sorry, no pricing available.” The problem is that in the Chatbot it shows the JSON output. It looks like back in 2022 there was an option to toggle “Keep only Set” which removed that JSON extra code. I also noted the HTTP response Node is gone as well.
I am not sure how to handle such a task in N8N now. The Docs seem out of date and so I’m fumbling around here trying to find the answer LOL.
What is the best way to do this? Thank you!
Example: What is the price of KTN-R-100?
Answer: { “”: “Sorry, no pricing available” }
I need the answer to be: Sorry no pricing available.
Solution:
- Use the
Set
node (which you already are):
- Set a new field like
message = Sorry, no pricing available.
- Add a
Function
node right after to clean up everything else:
return items.map(item => {
return {
json: item.json.message
};
});
This will strip away all other keys and just keep the message as the main string output, not wrapped in { "message": "..." }
.
3. If your output still looks like a JSON object inside your chatbot:
- Add a Final
Set
node with:
Mode
: Raw Parameters
Value
: ={{ $json }}
OR, if the platform allows:
- Convert it into a plain string using:
return [{ json: { text: String($json) } }];
Explanation:
- “Keep Only Set” was removed, but using a
Function
node gives you full control.
- You simulate its behavior by rebuilding a clean object manually.
- This helps avoid weird chatbot formats like:
{ "": "Sorry, no pricing available" }
Let me know if your chatbot expects a raw string vs JSON — I can tweak the last step accordingly.
1 Like