Issue with fetching key from json while passing to http request

Describe the problem/error/question

Pointing to the json key using “{{ JSON.parse($(“Merge1”).item.json.data).title }}” throws undefined value.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Output of last node -
[
{
“data”: "({\n "title": "Announcing the ability to subscribe webhooks to ticket and messaging events",\n "internal": false,\n "promoted": true,\n "url": "/hc/en-us/articles/9071412067738-Announcing-the-ability-to-subscribe-webhooks-to-ticket-and-messaging-events",\n "vote_sum": 0,\n "comment_count": 0,\n "created_at": "2025-03-27T17:03:38Z",\n "edited_at": "2025-04-01T20:52:55Z",\n "excerpt": "\n\n\nAnnounced on\nRollout on\n\n\nApril 1, 2025\nApril 1, 2025\n\n\n\nZendesk is excited to announce that you can now subscribe…"\n })\n \n "
}
]

Information on your n8n setup

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

The string on the data property is not a valid JSON.
You need to fix this somewhere closer to the source of this piece.
Hard to tell where it comes from unless you pin some data at critical nodes.

Thanks for responding @Olek! But when i give that string to json formatter it says its a valid json.


It is not allowing me to share the workflow with initial node pinned due to character limit capping. Have tried pinning the critical node towards the end though.
However this workflow can be executed and it will generate the data at all the nodes.

This

"({\n "title": "Announcing the ability to subscribe webhooks to ticket and messaging events",\n "internal": false,\n "promoted": true,\n "url": "/hc/en-us/articles/9071412067738-Announcing-the-ability-to-subscribe-webhooks-to-ticket-and-messaging-events",\n "vote_sum": 0,\n "comment_count": 0,\n "created_at": "2025-03-27T17:03:38Z",\n "edited_at": "2025-04-01T20:52:55Z",\n "excerpt": "\n\n\nAnnounced on\nRollout on\n\n\nApril 1, 2025\nApril 1, 2025\n\n\n\nZendesk is excited to announce that you can now subscribe…"\n })\n \n "

is not valid JSON. JSON.parse cannot parse it and that’s what you are trying to accomplish in your HTTP Request node.

The string on the data property is not a valid JSON.

^^ stands valid.

Thanks, that sounds fair. But can you also help me in getting only the title and updated_at keys from the payload? I am struggling with that.

Pin the data in the node where this string originates from and repost the workflow.

That payload is too big hence the character limit of 30k chars is not allowing me to do that. I’ve tried to truncate the html code by removing repetitive sections.
I need the content present inside ‘articles.push’ section

The upper branch doesn’t result in the output to the Merge node you provided before.
The lower branch - I do not have access to the spreadsheet to check. So no way to apply a quick fix.

I think this question falls beyond n8n scope and is more about data extraction and transformation.

Your options are:

The following works with the input you provided before.

You will need to figure out how to integrate this into your workflow. Accessing specific fields in the parsed object must not be a problem.

I am afraid I will not be able to help you out with other cases. You will need to figure it out on your own or wait for someone else to look into it any deeper.

You may try your luck on stackoverflow or reddit. Again, your challenge has actually nothing to do with n8n.

If the above resolves your initial question, please mark this post as a :white_check_mark: Solution.

1 Like

Thanks a ton @Olek ! This has solved the issue for me, you’re right the issue was related to parsing the data and not n8n. :raised_hands:

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