Hi @pipetman, as @rfeigel suggests, the Column Expressions node (or for variables, its Variable Expressions counterpart) is better suited for writing programmatic scripts and may be more straightforward, or at least easier to write!
String Manipulation and String Manipulation (Variable) can only accept a single statement, but you can achieve what you need using string replacement by “nesting” the replace statements:
replace(
replace(
replace($${SPlateFormat}$$, "96w", "# PlateFormat\t 8\t 12")
, "384w", "# PlateFormat\t 16\t 24")
, "1536w", "# PlateFormat\t 32\t 48")
The downside here is that because it is a replace statement, it will replace substrings too, and if it found the value “196w” it would still end up replacing the “96w” part. This may be undesirable.
Alternatively, String Manipulation (Variable) does have a conditional if-then-else syntax, but it looks a little odd. In this example it would replace only exact matches for the whole value:
string(
$${SPlateFormat}$$.equals("96w")
?"# PlateFormat\t 8\t 12"
:$${SPlateFormat}$$.equals("384w")
?"# PlateFormat\t 16\t 24"
:$${SPlateFormat}$$.equals("1536w")
?"# PlateFormat\t 32\t 48"
:$${SPlateFormat}$$
)
read “?” as “THEN” and “:” as “ELSE”, and conditions (which for strings must use the “equals” function/method, rather than “==” as IF
so this reads as
create a STRING such that...
IF $${SPlateFormat}$$ equals ("96w")
THEN "# PlateFormat\t 8\t 12"
ELSE IF $${SPlateFormat}$$ equals("384w")
THEN"# PlateFormat\t 16\t 24"
ELSE IF$${SPlateFormat}$$ equals("1536w")
THEN "# PlateFormat\t 32\t 48"
ELSE $${SPlateFormat}$$