Skip to Content

Specify Source and Target Fields Dynamically

In the configuration of a source or target, you can use global or project variables. These can be either ones that you define as part of a project, configure at runtime through the Management Console, or are Jitterbit variables.

Project variables can be used for this purpose, and then reconfigured at runtime using the Management Console.

For example, in an HTTP Source, you can enter in the URL field:

[ServerURL]

In a script that runs prior to that source being used, you would set the value of that variable.

In scripts, you reference a variable by using a dollar sign, such as

$ServerURL = "htttp://www.example.com";

You could do the same for your login (user name) and password. For example, you could enter in an HTTP Source configuration fields:

URL: [url]
Login: [username]
Password: [pwd]

The password variable would be typed or pasted blind (you would not see the final characters), but the data element will be replaced at runtime.

In a script you can set these variables and then call an operation that uses that source defined with the variables:

$url = ... ;
$username = ... ;
$pwd = ... ;
RunOperation(...);

The function RunOperation() can either run an operation either synchronously or asynchronously as described in its documentation.