Datetime - Calculate ➝ ternary operator in Duration field doesn't work

Describe the issue/error/question

Hi guys,

when I want to subtract (or add) a time unit (let’s say Days) from a date and use a ternary operator in the Duration field, it always operates with the first condition and even overwrites the variable used in the expression.

What is the error message (if any)?

No error, wrong output.

Please share the workflow

Share the output returned by the last node

format_ddd is 2 (should be Wed)
new_date is 2023-03-27T00:00:00.000Z (should be 2023-03-28T00:00:00.000Z)

Information on your n8n setup

  • n8n version: 0.218.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Found this topic Found a bug (?) with ternary conditions in Set node - #3 by Konstantin

== should be used instead of =

So not an issue.

Hey @antitalent,

I was just playing with this one and I noticed the same thing, Glad to see you worked it out and are up and running :raised_hands:

1 Like

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