Script Step
You can add a Script Step create your own unique Action Step by coding it in Xpath. Since this step does not follow a specific structure, it's output is usually the ScratchPad variable because it can be customized to fit the Xpath code.
To add a Script Step to the Action:
- Drag and drop a Script Step from the palette onto the process flow in the desired position.
- Double-click the script icon to open the Script Properties window.
- Enter a Description for what the Script step will do.
- Click the + button under Sources and select a variable to make it available to be used in your Xpath script coding. You can add multiple sources. Click the - button to remove a variable. Sources are not required.
When you declare a source you must define it as an external node(). The example below shows how to define the $ScratchPad variable as an external node().

- Click the Target drop-down and select a target variable. For unstructured data, use the ScratchPad Variable.
- In the Script box, enter your Xpath script.
-
Click Ok.
Example Script Step:
The following example is an Xpath script to find the square root of a field in the ScratchPad variable of an action and then put that value back into another field in the ScratchPad variable.

-
The first line of code enables the EXSLT math functions to be used in the script step
-
The second line of code is used to establish the ScratchPad as an external node, which is needed in order to use the fields in the ScratchPad variable.
-
The code inside the <ScratchPad> tags is used to define the values of each field of the ScratchPad variable.
-
OriginalValue is populated by the location of the 'OriginalValue' data field from the ScratchPad variable (in other words, it keeps its own value). If you don't do this, the value of that field will be lost.
-
SquareRoot is populated by taking the math:sqrt function from the path of the OriginalValue.