Kit
October 30, 2024, 5:59pm
1
Hello everyone! Here is a sample string manipulation I am performing. Is there a way to add an OR clause to this so I don’t have to call “$Vehicle Name$.contains” twice since the THEN clause is the same?
string($Vehicle Name$.contains("OA")?"OA"
:$Vehicle Name$.contains("SWI")?"OA"
I tried using “or” and “||” but neither of them worked.
@Kit there actually seems to be an undocumented feature where you can construct such rules:
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…
2 Likes
Kit
October 30, 2024, 6:27pm
3
okay, nice! yes, this is perfect, I just had the operator in the wrong place
this now works:
:$Vehicle Name$.contains("OA") || $Vehicle Name$.contains("SWI")?"OA"
2 Likes
system
Closed
November 6, 2024, 6:27pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.