In transformational modeling, parameters allow for dynamic configurations across environments. Parameters can be referenced in various project parts and ensure a flexible approach to model design, where changes can influence multiple elements in a project without manual updates to each instance.
Defining Parameters
Parameters can be defined at two levels:
Project (development) level: Parameters defined here apply to the project in development.
Environment level: These parameters are specific to a deployment environment.
The system validates the JSON format to ensure correctness.
Although the format and functionality are identical, project parameters and environment parameters are independent of one another.
Defining parameters
To define parameters at the project level, follow the instructions below. For instructions on configuring parameters for Environments, see the related post at the bottom of this article.
Go to Settings and Conventions > Parameters
Enter some key-value pairs in JSON format.
For this article and the following example references, we will use these sample values:
{
"region": "EMEA"
}
Defining parameters at the environment level
To correctly configure an environment and its parameters, refer to the Tx. Environments article referenced in the See also section.
Referencing Parameters
Parameters can be referenced in various sections of the project, including:
SQL and Jinja inputs: Use the syntax
{{parameters.<parameter_name>}
}.YAML inputs: Parameters can be referenced within YAML configurations, such as template properties, using
${parameters.<parameter_name>}
.
Examples of usage may include using them on template properties to ensure consistency across Tx Objects or embedding them in logic scripts within Tx objects to dynamically adjust functionality based on their values.
To reference parameters within a project, use double curly braces to dynamically include parameter values. Examples of how parameters are referenced:
In SQL and Jinja Scripts:
SELECT * FROM sales WHERE region = '{{ parameters.region }}';
In YAML or Project Properties:
name: ${parameters.region}
When running operations such as validating, selecting, creating, or running scripts, parameters are resolved to their defined values. If an error occurs or a parameter is not found, it resolves as a blank value.
When the operations are done as part of a deployment or run in an environment, the parameters set at the environment level will be used.
When the operations are triggered from within the project, the project parameters are used.
See also: