takbb
April 30, 2024, 12:43pm
12
Hi @KaboboJakobo , this is almost certainly because for at least one value that it is trying to manipulate, you have missing data.
Try this:
$$CURRENTCOLUMN$$==null?toNull("")
:replace(
capitalize(
regexReplace($$CURRENTCOLUMN$$, "(\\.\\s*)(\\S)", "$1¬$2")
, "¬")
, "¬", "")
This does a test, and if the particular value is null (missing) it returns toNull("")
which is how String Manipulation can return a missing value, otherwise it returns the calculated value as before.
You probably won’t find that syntax in the node documentation. For further info see here:
For a while now I’ve been using various features of String Manipulation that you won’t generally find documented. I guess therefore, that what I am writing here should be given the caveat “use at your own risk” since it is always possible that in the future, the String Manipulation (and its “(variable)” counterpart node) could be rewritten and the undocumented features would no longer work.
However, since it sits on top of java, and these features make use of its close relationship with java, i…
Specifically, the syntax of the conditional statement is described here:
Just for the excitement of having yet another option ;-)… if you really want to, you can do nested if statements within String Manipulation too. It’s hidden away, but it’s there:
e.g.
string(
$column1$.equals("Y")
?"Some result"
:$column2$.equals("Y") && $column3$.equals("N")
?"A different result"
:$column2$.equals("Y")
?"Yet another result"
:"Bored now!"
)
The syntax is
condition
? result if true
: result if false
and as you can see, you can nest the conditions. It’s…
1 Like