Skip to main content

Variables

The Variables module is the central place to manage reusable values in DataSync. A variable pairs a name with a specific value and allows you to substitute that name wherever the value is needed. This can be in filters, queries, or calculated fields across multiple extractions. By keeping these values in a single location, you maintain consistency throughout your project and avoid the effort of making the same change in multiple places.

Using variables simplifies maintenance and greatly reduces the chance of errors. Instead of editing every SQL statement that contains a certain value, you update it once in the Variables module and the change is applied everywhere the variable is used.

note

To use a variable in DataSync, type an @ symbol followed by the variable name: [FieldName] = @MyVar

When to use variables

  • Creating filters and queries: Dynamically filter extraction results or build queries that adapt to different parameter values.
  • Purging tables: Apply in migration extractions to clear table contents before loading new data.
  • Calculating field values: Use in transformations or calculated fields to standardize or automate repetitive logic.

In this section:

TopicDescription
Add a variableCreate a new variable by specifying its name and value for reuse in extractions, queries, and calculations.
Edit an existing variableUpdate the value or name of a variable to change its behavior across all associated extractions.
Delete a variableRemove a variable that is no longer needed in any extraction or transformation.
Insert RSD paramaters to API profileDefine runtime substitution parameters for API calls by assigning values to RSD variables in the API profile.

Example

Suppose you have a variable named @City with the value Toronto. Instead of typing Toronto multiple times in an SQL statement, you use @City:

WHERE Customers.City = @City

If the value changes to Toronto, ON, simply update @City in the Variables module. The change is automatically applied everywhere the variable is referenced, without having to edit each statement individually.