Substring
In the Graphical Data Mapping editor, you can use the Substring transform to set the value of an output element to a substring of the original input value. You use this transform to extract a subset of characters that are separated by a delimiter based on a position that you indicate with an index.
Overview
The Substring transform uses a delimiter and 0-based index to determine what text to extract from the incoming source string.
Based on the specified delimiter, the source string is divided into sections. The index is used to identify which section of the divided string you want to use.
'/'
.- If you set the Substring index property
to
0
, the transform returns the value '123'. - If you set the Substring index property
to
1
, the transform returns the value '124'. - If you set the Substring index property
to
3
, the transform returns the value '126'.
By default, the Substring index has a value of 0, that indicates that the first section will be used.
Inputs to the Substring transform
The Substring transform takes multiple input elements.
You wire one simple type input to the Substring transform as primary connection. This input contains the input value from which you need to extract part of it.
You can wire more inputs as supplementary connections. These other inputs are used to define the conditional expression that determines if a transform is applied.
Define when the transform is applied at run time
You can define multiple connections between input elements and the Substring transform. You can then use these input elements in a conditional expression that defines the condition under which the transform is applied. If the condition evaluates to true, the transform is applied.
Alternatively, to define the conditional expression, you can call a static method on an imported Java™ class. You can also create a complex expression comprising XPath, Java and extension functions such as iib:getUserDefinedProperty("propertyname").
You configure the expression in the Condition tab that is available in the Properties page of the transform.
For more information, see Configuring the properties of a transform, Defining an XPath conditional expression for a transform and Defining a Java conditional expression for a transform.
You can use the inputs connected with a primary connection to the transform. To add more inputs, you can define supplement connections between input elements and the transform.