Hi All,
I have two columns "strCellphone" and "strPhone". I want to create a new column "Phone" and Copy values from "strCellphone" but if "strCellphone" is empty, I want to copy values from "strPhone". I tried this with JS and it works on a normal editor but on Pentaho, I am not getting results as expected.
Here is my JS snippet:
var phone = strCellphone ;
if (!strCellphone.length){phone = strPhone;}
I have also tried various ways of checking null, empty like this one -> if (!strCellphone.length || strCellphone === ' '){phone = strPhone.getString();}
On Pentaho, The result is always assigned to if "strCellphone" even if it is empty.
Can you tell me what could be the problem? Thanks!
I have two columns "strCellphone" and "strPhone". I want to create a new column "Phone" and Copy values from "strCellphone" but if "strCellphone" is empty, I want to copy values from "strPhone". I tried this with JS and it works on a normal editor but on Pentaho, I am not getting results as expected.
Here is my JS snippet:
var phone = strCellphone ;
if (!strCellphone.length){phone = strPhone;}
I have also tried various ways of checking null, empty like this one -> if (!strCellphone.length || strCellphone === ' '){phone = strPhone.getString();}
On Pentaho, The result is always assigned to if "strCellphone" even if it is empty.
Can you tell me what could be the problem? Thanks!