Skip to end of metadata
Go to start of metadata

Introduction

All transformation mappings are made up of scripts on individual nodes and fields within a target schema.

You do not necessarily need to manually create those scripts in order to create the mapping; many mappings are created visually, such as by dragging and dropping source objects or variables to a target field, but they result in a script being created behind the scenes. Regardless of the method used to create the mapping, the result is always the same: a script on a target node or target field.

This page covers how to open transformation scripts and reference project components and functions within them, although note that any valid script logic can be used.

Opening a Field Script

Before you can add script logic, you need to enter the view that will allow you to edit the script for an individual field or node. Adding a script on a node is covered separately under Conditional Mapping.

To add a new script on a target field, in either mapping mode or script mode, hover over the target field and click the plus icon  in the top right of a target field to open a menu of actions. From the menu, select Add Script:

To edit a script on a target field that already has a mapping, in either mapping mode or script mode, click the script icon  in the top right of a target field.

This opens the editable script area on the target field in script mode, where you can enter or edit the script logic for the mapping:

Below the script area, text indicates whether the script is valid. For information on script validation, see Jitterbit Script.

To toggle the script area back to the original block display, click the collapse icon .

For a larger script area to work within, click the popout icon  in the upper right of the target field, which opens the full script editor. Once within the full script editor, click the return icon  to come back to this screen.

To remove the script, simply delete the text of the script.

Adding a Source Object

Within the component palette, a list of functions available to use in a script is provided within the Source Objects tab:

Add a source object to the Jitterbit Script using one of these methods:

  • Drag the object from the palette to the script. The full reference path to the source object using the appropriate syntax will be inserted.
  • Manually enter the full reference path to the source object.

For an explanation of the node/field notation, refer to Nodes and Fields. Refer to Mapping Source Objects for detailed information about mapping source objects, including by adding a source object to the script.

Adding a Function

Within the component palette, a list of functions available to use in a script is provided within the Functions tab:

Add a function to the Jitterbit Script using one of these methods:

  • Drag the function from the palette to the script. The appropriate syntax for the script language will be inserted.
  • Begin typing the function name and then press Control+Space to display a list of autocomplete suggestions. Select a function to insert the appropriate syntax for the script language.
  • Manually enter the appropriate syntax for the script language.

For detailed information about using scripts, refer to Scripts. Refer to Functions for additional information on using functions as well as comprehensive documentation on Jitterbit functions.

Adding a Variable

Within the component palette, a list of variables available to use in a script is provided within the Variables tab:

Add a variable to the Jitterbit Script using one of these methods:

  • Drag the variable from the palette to the script. The appropriate syntax for the script language will be inserted.
  • Begin typing the variable name and then press Control+Space to display a list of autocomplete suggestions. Select a variable to insert the appropriate syntax for the script language.
  • Manually enter the appropriate syntax for the script language.

Refer to Mapping Variables for detailed information about mapping variables, including by adding a variable to the script. Also see Scripts for information about using scripts, and Variables for details about using variables in scripts.

Adding a Plugin

Within the component palette, a list of plugins available to use in a script is provided within the Plugins tab:

NOTE: Not all plugins are able to be used within scripts. Additional plugins can be applied on an activity within an operation. For more information see Plugins.

Add a plugin to the Jitterbit Script using one of these methods:

  • Drag the plugin from the palette to the script. Both the RunPlugin() function and the plugin reference will be inserted into the script.
  • Begin typing the plugin name and then press Control+Space to display a list of autocomplete suggestions. Select a plugin to insert the plugin reference into the script.
  • Manually enter the plugin reference.
NOTE: The plugin name is from the XML manifest and is not necessarily the same as the display name in the Management Console.

For detailed information about using scripts, refer to Scripts. For documentation on using plugins, see Plugins.

Adding an Operation

Within the component palette, a list of operations available to use in a script is provided within the Operations tab:

Add an operation to the Jitterbit Script using one of these methods:

  • Drag the operation from the palette to the script. Both the RunOperation() function and the operation reference will be inserted into the script.
  • Begin typing the operation name and then press Control+Space to display a list of autocomplete suggestions. Select an operation to insert the operation reference into the script.
  • Manually enter the operation reference.

For detailed information about using scripts, refer to Scripts. For documentation on operations, see Operations.

Adding a Notification

Within the component palette, a list of notifications available to use in a script is provided within the Notifications tab:

Add a notification to the Jitterbit Script using one of these methods:

  • Drag the notification from the palette to the script. Both the SendEmailMessage() function and the notification reference will be inserted into the script.
  • Begin typing the notification name and then press Control+Space to display a list of autocomplete suggestions. Select a notification to insert the notification reference into the script.
  • Manually enter the notification reference.

For detailed information about using scripts, refer to Scripts. For documentation on notifications, see Notifications.

Adding a Script

Within the component palette, a list of other scripts that are available to use in a script is provided within the Scripts tab:

Add another script within the Jitterbit Script using one of these methods:

  • Drag the script from the palette to the script. Both the RunScript() function and the script reference will be inserted into the script.
  • Begin typing the script name and then press Control+Space to display a list of autocomplete suggestions. Select a script to insert the script reference into the script.
  • Manually enter the script reference.

For additional documentation, see Scripts.

For detailed information about using scripts, refer to Scripts.

Adding Endpoints

Within the component palette, a list of endpoints that are available to use in a script is provided within the Endpoints tab:

Add a connection or activity to the Jitterbit Script using one of these methods:

  • Drag the connection or activity from the palette to the script. The connection or activity reference will be inserted into the script.
  • Begin typing the connection or activity name and then press Control+Space to display a list of autocomplete suggestions. Select a connection or activity to insert the appropriate reference into the script.
  • Manually enter the connection or activity reference.

Depending on the specific endpoint type, you use functions from the Functions tab that take the endpoint reference as the argument. The specific functions that can be used are described under Endpoints in Jitterbit Script.

For detailed information about using scripts, refer to Scripts.

On This Page

Last updated:  Nov 20, 2019

  • No labels