HTTP node empy output when body response contains new lines

Describe the issue/error/question

Hey! I’m trying to create a new document using Crove API and in the second node, update the first node with some data, but for some reason the output is empty when I have line breaks in the body.

I’ve tried to implement the solution from here: HTTP node error when body response contains new lines - #9 by Darius_Dumitru , but
the problem is that without the “{{ }}” in the second node, it says Invalid JSON. But when I add those “{{ }}”, the JSON output for “response” is just empty.
If I remove the “{{ }}” and have the body expression without new lines, everything is working fine.
Here are 2 screenshots regarding this. Can someone please help me?

What is the error message (if any)?

No error, but just doesn’t work.

Please share the workflow


Hi @Darius_Dumitru, can you confirm the JSON data you are passing on to your HTTP Request 4 node? I suspect the problem is similar to what I’ve described here, but it would be good to have some actual data to reproduce this in your case.

@MutedJam
EDIT 3:

Now it’s working!! It works even with line breaks into expression. That’s really great!! Thanks a lot!!

Here’s the expression that worked:
“{{ JSON.stringify({“response”: {“1666601887886”: “nr contract”,“1666601611336”: “tip website”,“1669139697371”: “- Test1
-Test2
-Test3
-Test4
-Test5”,“1666602179025”: “pret mentenanta”, “1666592291921”: “pret”,“1666605764308”: “avans”}})}}”

1 Like

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