How to use "If~Then~Else" in Converters and Expressions on DS


 We will explain how to use the conditional branch expressions "If ~ Then ~ Else" in converters and expressions on DS.

  There are differences between using the "If Then" format and using the "If-Then-Else" format when executing conditional branching based on "If~Then~Else".


 If ”A” is included in the character string of the variable "text", output ”B", else output ”C”.

■Using "If Then" in Converters
 In Converters, select: Other > If Then

(Figure1."If Then" in Converters)

 Select "If Contains" after clicking the Add button.
(Figure2.Selecting a condition for "If Then")

 Specify a condition and a process.
(Figure3.Specifying a condition for "If Then")
■Using "If-Then-Else" in Expression
 Select: Expression → Operators → If-Then-Else.

 Write the condition and the processing in the following format.

  b  ?  e1  :  e2   ( [ Boolean expression ]  ? [  Expression 1 ]  :  [ Expression 2 ])

 If the value of the Boolean expression is True, the output will be e1, but if it is False, the output will be e2.

 If you want to set "If Contains" as you did for Converters, but this time in the Expression field, select "Contains: contains (source, text)" in "Functions".
(Figure5."IfThenElse" in Expression)

An error will occur if you use the "If ~ Then ~ Else" format in Expression. Please be careful when using conditional branching either with converters or expressions.

1 out of 1 found this helpful



Article is closed for comments.