Expression not working?

Hi,

I want to know how to solve. and use the expression without changing the item

Information on your n8n setup

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

Happened to me as well, but I deleted the expression and instead dragging, I start writing it, and became green.

How to write it?

I try to write it too, but it doesn’t turn green at all !!

the solve:

{{ $item(1).$json.parsed_sections.raw_text }}

1 Like

Hello @AhmedAlnaqa

From the screenshot, it’s clear that the issue is in the Merge node logic,
You’re probably using it in Append Mode, which will output more than one item..

The reason your expression {{ $json.parsed_sections.raw_text }} doesn’t work is because this data comes from the second item.

So at this point, you have two options:

  1. If you know the location, you can use this expression: {{ $('PrepDateControl').all()[1].json.parsed_sections.raw_text }}

  2. The better approach is using the Merge node with Combine Mode and combine by All possible combinations, This will give you one item with all data merged, so you can easily reference it without write the location of the data,
    and the expression {{ $json.parsed_sections.raw_text }} will work as you’re expecting.

1 Like

Thanks, Mohamed for ur support, but

This is applicable in cases where there are only two inputs. I am working with 5 inputs.

I don’t know what your input looks like, but you could try “Combine By Position”

I explained the point i am talking about here because you should not use this expression under any condition:

The correct equivalent for it is:

{{ $('PrepDateControl').all()[1].json.parsed_sections.raw_text }}
1 Like

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