Formats for variables

You can use attributes from your project data set as variables in your transformation scripts. This allows you to pass attributes to transform functions as parameters and perform other operations on them.

To include an attribute in a transformation, you can reference it using the formats described below. The specific formats you can use for a given attribute depend on whether its name meets the following requirements:
Note: Unlike other variables, attributes don't need to be declared.

This table describes the formats you can use to include attributes as variables in transformations.

Format syntax Description
<attribute> Attribute names that consist of a letter or underscore (_) followed by zero or more alphanumeric characters (a-zA-Z, 0-9) and underscores. Names can't contain any of the reserved keywords from either the Transform area in Studio, or from Groovy.
row["_<attribute>"] The map format. This can be used for all attributes, including those whose names don't meet the naming requirements described above. You can use single or double quotes.
row."_<attribute>" The long dot format. This can be used for all attributes, including those whose names don't meet the naming requirements described above. You can use single or double quotes.
row._<attribute> The short dot format. This can only be used for attributes whose names consist of alphanumeric characters, dollar signs ($), and underscores.
Note: The format you use for an attribute affects how it is handled by the static parser. For more information, see Exception handling and troubleshooting your scripts.