Problem with Variable within an Expression

I am trying to use an if() expression with a variable like so -

{{ $if($(‘Loop Over Items2’).item.json.row_number = 3, “Here is an image URL for this section, please integrate it within the section text with left alignment and wrap around text - $(‘HTTP Request8’).item.json.guid.rendered”, “”) }}

This should print the variable (a URL) IF the row number = 3…right?

Except this is what it returns -
Here is an image URL for this section, please integrate it within the section text with left alignment and wrap around text - $(‘HTTP Request8’).item.json.guid.rendered

It is merely printing the variable text, not the actual value. What am I doing wrong?

Information on your n8n setup

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

Hey @Anthony_Lee , you are assigning the number 3, not comparing. To compare, use == instead.

1 Like

Ah. Thank you

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