If Then
The If Then data converter allows for specification of a list of if-then rules that determine the output of the converter.
The list can consist of multiple if conditions and has always one else block at the bottom, which provides the default value.
- Basic Conditions
-
If Contains, If Does Not Contain, If Starts With, and If Ends With condition types provide a check into whether the input string contains, does not contain, starts with or ends with the given string accordingly.
If Matches Pattern and If Does Not Match Pattern condition types provide a check into whether the input string matches or does not match a pattern.
Properties for Basic Conditions
The basic conditions of the If Then data converter can be configured using the following properties.
If Contains
If Does Not Contain
If Starts With
- If Ends With
-
A text value is entered which is matched against the input text.
- If Matches Pattern
- If Does Not Match Pattern
-
In these fields a pattern is entered which is matched against the input text. Note that the entire input text must match / not match the pattern.
- Then
-
Specifies the output text if the value of the property above matches the input text. The value can be specified in several ways using the Value Selector (without converters).
- Ignore Case
-
If this is checked, the matching against the value of the first property is done without regard to the character case, e.g. "KoFaX" is considered equivalent to "KOFAX" and "kofax".
Properties for Else
The else statement of the If Then data converter can be configured using the following property.
- Then
-
Specifies the output text if no conditions matched the input text. The value can be specified in several ways using the Value Selector (without converters). If this field is left blank, then the If Then converter returns an empty text.
In the If Matches Pattern the expression in the Then attribute can refer to submatches of the pattern in the preceding If Matches Pattern field using the $n notation.
In all the other conditions the INPUT keyword can be used to refer to the input text.
Other Properties
The If Then data converter can additionally be configured using the following properties:
- Description
-
Type in a description to be shown in the list of data converters. If there is no type in a description, one will be generated.
- Examples
-
Let us assume that the input text is "911" and we want the output text to be "Porsche 911". Alternatively, if the input text is anything other than "911", it should remain as is.
The If Then data converter should then be configured as follows:
-
If Matches
- If Matches: 911
- Then (expression): "Porsche " + $0
- Ignore Case: [unchecked]
-
Else
- Then (expression): $0
-