Stopping escape characters

Describe the issue/error/question

I have some JavaScript that takes the data from the webhook and reformats it with the intention of creating some html that I’m going to POST to Asana later in the process (using an HTTP request, since the inbuilt Asana node doesn’t support the “html_notes” field.)

The goal is to create some line-items and I don’t know how many line items it is, so I’m including a \n between each item. The problem is that n8n is throwing in an escape character automatically so it is seeing it as \n, posting it to Asana as \n, and then Asana is displaying it as text \n. How do I stop this normally helpful feature?

What is the error message (if any)?

None

Please share the workflow

I tried, but I got an error message about number of links in the post.

Here is the script in the function:

And here is where it is referenced later:

and pushed:

Share the output returned by the last node

Information on your n8n setup

0.186.1

Hi @EricSGS, it looks like you’re using /n rather than \n in your JS code. Changing this would lead to n8n recognizing the line break, in the JSON preview you can see this indicated by spaces:

Sending this data to a service such as webhook.site you can see that n8n wouldn’t add additional escape characters:

Example workflow:

Yeah, that’s it. Darn.

Thanks for the fix! Sorry about that! Works perfectly now!

1 Like

No worries, glad to hear this helped :slight_smile: