1.7

Table Of Contents
A script can be used to set boundaries for a data source (see "Setting boundaries using
JavaScript" on page233). The script determines where a new record starts.
Scripts can also be used in different steps in the extraction workflow. You can:
l Modify the incoming data prior to executing the rest of the extraction workflow, via a
Preprocessor (see "Preprocessor step" on page116).
l
Edit extracted data in a field of the Data Model using a Post function script (entered on
the Step properties pane, under Field Definition; see "Modifying extracted data" on
page132 and "Text File" on page193).
l
Enter a script in a JavaScript-based field (see "Adding a JavaScript-based field" on
page130). Note that the last value attribution to a variable is the one used as the result of
the expression.
It is possible to refer to previously extracted fields if they are extracted higher in this list or
in previous Extract steps in the extraction workflow.
l
Let an Action step run a JavaScript, or use JavaScript to add a value to a property
defined in the Preprocessor step.
l
Change the left and right operands in a Condition step to a JavaScript expression. (On
the Step properties pane, under Condition, set Based on to Javascript; see "Condition
step properties" on page214 and "Left operand, Right operand" on page217.)
l Further process the resulting record set after the entire extraction workflow has been
executed, via a Postprocessor (see "Postprocessor step" on page124).
The script can always be written directly in a small script area or in the Edit script dialog. To
invoke this dialog click the Use JavaScript Editor button .
Tip
In the Edit script dialog, press Ctrl + Space to bring up the list of available JavaScript objects
and functions (see Datamapper API). Use the arrow keys to select a function or object and press
enter to insert it. Type a dot after the name of the function or object to see which features are
subsequently available.
Keyboard shortcuts for the script editor are listed in the following topic: "Keyboard shortcuts" on
page659.
Page 231