2018.2

Table Of Contents
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
page845.
Syntax rules
In the DataMapper, all scripts must be written in JavaScript, following JavaScript syntax rules.
For example, each statement should end with ; and the keywords that can be used, such as var
to declare a variable, are JavaScript keywords. There are countless tutorials available on the
Internet to familiarize yourself with the JavaScript syntax. For a simple script all that you need to
know can be found on the following web pages: W3Schools website - JavaScript Syntax and
https://www.w3schools.com/js/js_if_else.asp. A complete JavaScript guide for beginners can
be found here: https://developer.mozilla.org/en-US/docs/Web/JavaScript.
DataMapper API
Certain features that can be used in a DataMapper script do not exist in the native JavaScript
library. These are additional JavaScript features, designed for use in Connect only. All features
designed for use in the DataMapper are listed in the DataMapper API (see DataMapper API).
External JavaScript libraries
The External JS Libraries box on the Settings pane lets you add JavaScript libraries to your
configuration and displays all the libraries that have been imported (see "Settings pane" on
page266).
You can use JavaScript libraries to add more JavaScript functionality to your data mapping
configuration. Any functions included in a JavaScript library that is imported in a data mapping
configuration will be available in Preprocessor scripts as well as Action tasks, Post functions
and JavaScript-based extraction steps.
Page 322