User other value if no data exist from previous node

Hey there,

I did ask this question already Ifempty in expression but the solution seems not to work in this case or maybe it does only work if the first value is available within that firstvalue || secondvalue

At the moment I get this message (No output data returnedn8n stops executing the workflow when a node has no output data. You can change this default behaviour via Settings > “Always Output Data”.) in the set node where I do want either one value or the other depending on the IF node true or false

This is my workflow

Any advice is appreciated

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 did solve it with that code node

but wonder if there is not an easier solution or maybe something I can use in the expression of the node where the customer_id is needed?

1 Like

Hi @Sebastian1! Thank you for reaching out and being a part of the community!

Yes, you can solve it in the expression field with a ternary like @liam mentioned in your previous post.

Here’s an example workflow:

1 Like