JSON Parse with \n

Describe the problem/error/question

I use ChatGPT Assistant to return the result in JSON.
On and on and on, after fixing hundreds of times in the instruction, that stupid assistant still return the results that have \n inside the quotation mark.
Cannot fix that! It’s on OpenAI. I can parse a month ago but don’t know why now cannot return on the right way.

What is the error message (if any)?

Below are what I did, including

  • The old way I use parse. Now it’s not work because there is a syntax error in the "Job-Related Examples" field of the second object.
"Job-Related Examples": "@And\nreessenHorowitz, @fintechfrank, @CoinMarketCap",
// There is \n after @And
  • I also use edit field to transfer to array but can. Yup, because of systax error above.
  • The input of the last note - “manual extraction” is the output of the node “String” that I manually add to. And It’s ok to use.

Please help me make the output like the node “manually extraction” auto?

Please share your workflow

I share the workflow on next reply.
Please check it there

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I just search and replaced the newline symbols with an empty string to clean up your JSON and that did the trick:

2 Likes

Thanks a lot.
But I don’t know how to transfer your last node into table of items.
Can you help.

Ah sorry, you can do that with the Split Out node - just point it to the element holding the array that you want to convert into items:

2 Likes

I mean parse the whole before, not just selected items only.
I used the old parse node, and then this case solved.
But when using on other case that have the same kind of data structure, it’s not work.

I’m sorry but I’m afraid I don’t follow - I just ran your example above and it outputs the expected data?