Split json from a summary

Describe the problem/error/question

I´m kind of stuck,

i am trying to get each field separately.
Could someone point me in the right direction?

{
“summary”:
“{ “title”: “Does it suck to be a follower?”, “translation”: “Does it suck to be a follower?”, “summary”: “Sometimes you have to ask yourself: does it suck to be a follower? Job boards are followers by nature and can’t compel employers to do anything they don’t want to. However, job boards can slip in intelligent guidance and help employers find what they need. To lead, job boards can focus on teaching high school students how to find work that fits their skills, desires, and hopes. This post is from 2021 and is still relevant today.”, “date”: “22.08.2023”, “location”: “”, “keywords”: [ “job boards”, “followers”, “employers” ], “source_url”: “Does it suck to be a follower? - Job Board Doctor” }”
}

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

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:

Hi @Kool_Baudrillard :wave:

Could you share your workflow by hitting cmd/ctrl c + cmd/ctrl + v in the workflow editor, and then pasting it here between three backticks (```)? Can you also let us know the following:

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

Hi @Kool_Baudrillard, as suggested by @EmeraldHerald we don’t quite know what your doing, but it looks like you might have a summary string field containing a JSON-like string.

If so, you can parse this using JSON.parse(). Here’s a quick example workflow (created on [email protected]):

Result:

Hope this helps!

4 Likes

awwww, thx! Exactly what I needed!

1 Like

Hello @MutedJam!

I’m trying exactly this but it didn’t worked. What am I missing?

I’m trying exactly this but it didn’t worked. What am I missing?

Hi @Lucas_Santos, pretty much what it says in the error message. Your example data structure is an array rather than a single object like in the original post.

Based on your screenshot you probably want to use “Run Once for All Items” as your Mode and JavaScript code like this:

return JSON.parse($input.first().json.data);

1 Like

That’s it! Thank you very much

1 Like

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