JSON Payload Formatting Issues

I am having a weird problem where if I copy the top level [ ] of the JSON and paste it into VSC it shows the payload with proper validated format line breaks etc. If i break the same element out in N8N and/or pass the element it formats the element based on what it has in the payload, but i just want to pass it the way it comes in because it’s breaking when i try to pass it formatted.

Hey @blachole,

It looks like there is still some information missing that could be useful, Are you able to share the workflow maybe and also the data that is coming out of the node?

It’s hard for me to share this due to confidential information and creds.

I guess I am having issues trying to explain the problem, but it’s mostly how its coming formatted. At the top level of the JSON payload [ … ] it has the payload elements the way its properly validated including line break tags and formats, but when i just pass the element itself it comes through formatted (line breaks injected and other illegal characters) which is not valid JSON. I guess is there a way to pass the JSON string exactly how its coming in without it being formatted?

Hey @blachole,

That is the bit I don’t understand, A lot of the time we shouldn’t be formatting the data which is the workflow and some data would help show more on what is going on.

Have you tried sending dummy data to a webhook assuming that is what you are doing and seeing if that has the same issue?

@Jon - I agree it shouldn’t be formatting it. Maybe I am passing it on incorrectly. When I call the JSON element as an expression it’s bringing it over formatted and not as the original JSON format.

Hey @blachole,

Looking at that the front end is just displaying it in a friendly way it looks like everything is still there for it to be displayed like that though.

Have you tried firing the request off to webhook.site or similar to see how it looks there? Maybe stringify might help?

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