How to pass JSON text without escaping line breaks in Make.com?

What are you trying to achieve?

I want to pass text in JSON through HTTP → Make a Request without automatically adding escaped characters like \n. I need the lines to remain as real line breaks instead of being converted to \n in the final request.

Example of the expected JSON output:

json
Копировать
Редактировать
{
“message”: {
“LANG”: “RUS”,
“description”: "This is an example text with real line breaks:

  • First line
  • Second line
  • Third line"
    }
    }
    Right now, Make automatically converts line breaks into \n. How can I disable this behavior or send the text as a “clean” JSON without escaping the line breaks?

Thank you for your help! :pray:

Steps taken so far

I am receiving data from the GPT module. Then, I tried creating the JSON using different modules like Set Variable and JSON. Finally, I send the data through a Webhook.

However, instead of sending a simple multi-line text, I keep getting escaped line breaks (\n) and double escapes (\n\n).

I also tried formatting the text manually and using various functions to clean the output, but Make still adds the escape characters automatically.

How can I send a clean JSON with real line breaks instead of these escaped characters?

Hey Pavel,

just to clarify - \n is the correct new line character and technically this is what is actually in the file. What seems to be happening is that Make doesn’t escape it.
Try using the replace() formula on your input to change the single slash to double slash. This should do the trick and not break the JSON.

Should be something like this:

replace({{input}};\n;\\n)

Welcome to the Make community!

You cannot have an actual line break in-between a string value in JSON. This makes it invalid.

Special characters have to be “escaped” — converted to a representation because those special characters could mean something else, like being used in the JSON format.

When you call it “clean” — you meant invalid. Try pasting your JSON here to see if it’s valid format: You can check if a JSON is valid by copy-pasting into jsonformatter.org and click “Format / Beautify” and/or “Validate”.

If your JSON is invalid, this tool will help point out where you need to look at!

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.