Column Expression AND OR with conditional

Hi everyone, I am using the Column Expressions node to make a conditional using other columns. Basically, I want to change COLUMN_A by “A” when 3 conditions are meet (see image).

I was using this expression but is not working

if(length(string(column("ID"))) == 10 & (left(string(column("ID")),1) === "8" | left(string(column("ID")),1) === "9") & column("COLUMN_B") === "Z" )  {
    "A"
    }
else{
    column("COLUMN_A")
    }

I am also attaching the workflow.

Cheers

Column Expressions Question.knwf (12.1 KB)

Column expression uses Java syntax. So, no “===” just “==” equation.

1 Like

Hi @izaychik63 thank you for the reply, I did this modification

if(length(string(column("ID"))) == 10 & (left(string(column("ID")),1) == "8" | left(string(column("ID")),1) == "9") & column("COLUMN_B") == "Z" )  {
    "A"
    }
else{
    column("COLUMN_A")
    }

But it is not working

Thank you

I checked

is 13 not 10.

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