There are two versions of the script editor: (1) the full script editor that is the default for scripts created as a project component and (2) the inline script editor that is present in transformations, which can be expanded to the full script editor by clicking the popout iconin the upper right of a script.
The full script editor contains all options covered on this page, while the inline editor offers a pared down version for quick editing.
For more information on types of scripts, see Script Types and Creation.
Accessing the Script Editor
The full script editor is the default script editor for scripts created as a project component:
To access the full script editor from within the inline version present within transformations, click the popout iconin the upper right of the script:
The full script editor interface opens:
Renaming a Script
When you create a new script, its default name is New Script. Subsequent new scripts with default names are appended with an incremented number in parentheses. Script names within a project must be unique and must not contain forward slashes (
/) or colons (
:) to be valid.
To rename a script from within the script editor, edit the Script Name field in the top left:
Scripts can also be renamed from these locations:
- The project pane's Workflows tab (see Component Actions Menu in Project Pane Workflows Tab).
- The project pane's Components tab (see Component Actions Menu in Project Pane Components Tab).
- The design canvas (see Renaming Workflows, Operations, and Operation Steps in Design Canvas).
You can add custom notes to a script that serve as documentation or reminders for yourself or project collaborators. To add a note, click the note icon next to the script name:
An editable area opens, where you can enter the text of your note. Click Post to add the note on the script:
Your posted note is displayed, along with your name and a timestamp. Anyone with edit access to the script can remove notes by clicking the remove icon. To close the note, simply click another part of the interface.
When one or more notes are present, the note icon color is displayed in orange:
Additional notes can be added using the same method described above.
Saving and Viewing the Save Status
After making changes to a script, the script configuration saves automatically. To manually save the script, press
Control+S (Windows or Linux) or
The save status is displayed along the top of the script below the script name. These statuses are possible:
To learn more about auto-save, see Cloud Studio Permissions, Collaboration, and Saving.
Selecting the Script Language
Scripts created within a transformation, either on a target field or on a node, are limited to Jitterbit Script language.
Toggling Edit and Test Modes
Scripts are opened in edit mode by default. To open the script in test mode, use the toggle in the top right to select Test:
For further details, see Script Testing.
Closing the Script
To exit the script and return to the previous screen, click the close iconin the top right.
Building the Script
In Jitterbit Script, scripts must be enclosed within a
<trans> opening tag and
</trans> closing tag, unless using functions that specifically call for code to be placed outside of these tags, such as several Database Functions.
These are the main features of the script area:
- Syntax highlighting: Different colors are used to distinguish the different parts of an expression, such as function names, strings, and variables.
- Bracket highlighting: If you place the cursor immediately before or after a bracket that is part of a set of opening and closing brackets, each bracket of the set is displayed with a border around the bracket to highlight the set. These sets of brackets are highlighted:
- Line numbering: Line numbers are displayed along the left margin of the script area.
Auto-validation: Harmony provides basic syntax checking and highlighting of lines with errors. If the script passes basic syntax validation, a line below the script area reads Script is valid. If the script does not pass basic syntax validation, specific error information is provided here one line at a time. That is, after resolving an error on one line, additional syntax errors to resolve may be reported for subsequent lines.
- Drag-and-drop: Dragging an item from the component palette to the script area automatically inserts the item in the appropriate syntax for use within the script.
Auto-completion: As you type, you can display autocomplete suggestions that begin with the entered string by using
Control+Space. When only one suggestion is available, it is inserted automatically. When more than one suggestion is available, you can navigate through the list using the keyboard arrow keys and press
Tabto insert the suggestion into the script area.
- Block indentation: When a complete line or lines are selected, pressing
Tabindents the selected lines one tab stop to the right. Similarly,
Shift+Tabmoves out the selected lines one tab-stop to the left. If no text is selected,
Shift+Tabmoves the line left to where the cursor is.
In addition, standard browser features for undo, controlling font size, and searching within the script may be used.
Adding Components from the Palette
Within a transformation script, you can reference source data by inserting a field's reference path, or you can reference source data nodes by inserting a node's reference path. To add a field or node reference path to a transformation script (Jitterbit Script only), use one of these methods:
To add a field or node reference path to a transformation script (Jitterbit Script only), use one of these methods:
Variables: This tab provides access to variables that are available to reference globally throughout a project, including global variables, project variables, and Jitterbit variables. Within a script, you can use variables by inserting the variable syntax.
Plugins: This tab provides a list of plugins that can be run inside a script. Within a script, you can use a plugin as an argument for the To add a plugin reference path to a script (Jitterbit Script only), use one of these methods:
To add a plugin reference path to a script (Jitterbit Script only), use one of these methods:
Operations: This tab provides a list of operations in the project that are available to reference in a script. Within a script, you can use an operation as an argument for functions by inserting the operation reference path. To add an operation reference path to a script (Jitterbit Script only), use one of these methods:
To add an operation reference path to a script (Jitterbit Script only), use one of these methods:
Notifications: This tab provides a list of notifications in the project that are available to reference in a script. Within a script, you can reference a notification as an argument for the To add a notification reference path to a script (Jitterbit Script only), use one of these methods:
To add a notification reference path to a script (Jitterbit Script only), use one of these methods:
To add a script reference path to a script (Jitterbit Script only), use one of these methods:
Endpoints: This tab provides a list of endpoints in the project that are available to reference in a script. Within a script, you can reference endpoints as an argument for functions by inserting the connection or activity reference path.