Skip to Content

Map variables in transformations in Jitterbit Integration Studio

Introduction

You can use variables to pass dynamic values into your transformation mappings.

You can use three types of variables in transformations:

Access variables

When you access a transformation, variables appear in the Variables tab on the source (left) side. Icons indicate the variable type:

Source structure variables tab

  • Project variable
  • Global variable
  • Jitterbit variable

A solid background () indicates that the variable has a default value.

Variables also appear in the Variables tab of the script component palette, organized by type.

Map variables to target fields

You can map variables using these three methods:

  • Drag and drop: From the Variables tab in the source structure or the script component palette, drag a variable to a target field.

  • Double-click: While editing a script, position your cursor in the target field script and double-click the variable to insert its reference.

  • Enter manually: While editing a script, type the variable reference using a dollar sign: $variableName.

Variable references in transformation scripts

Variables are prefixed with a dollar sign ($) when used in scripts. For example, $variableName.

You can also reference variables using the Get function (or Set for Jitterbit variables):

Get("variableName")

The variable name depends on how the variable was defined:

  • Local variables use the name you assigned: $tempValue or Get("tempValue").
  • Project variables use the name you assigned: $myProjectVariable or Get("myProjectVariable").
  • Global variables use the name you assigned: $myGlobalVariable or Get("myGlobalVariable").
  • Jitterbit variables use predefined names with periods: $jitterbit.operation.name or Set("jitterbit.operation.name", "My Operation");.

Create new variables

You can add a new variable when you view a transformation using one of these methods:

  • Project variables: In the source structure's Variables tab, click Create New Project Variable or from the script component palette, click Add New.

    New variables location

  • Global variables: Defined in scripts using this syntax: $globalVariableName = "value";. Global variables must be declared upstream of where they're used.

Note

When you use variables in transformations, note these considerations:

  • Global variables without initialization default to empty values.
  • Some Jitterbit variables may not apply to your specific operation.