User Guide : Designing and Executing Map : Managing Constants
 
Share this page                  
Managing Constants
A constant is a user-defined value that remains constant through out the transformation. The value of a constant is evaluated once at the beginning of a transformation regardless of how often they are referenced and thus improves processing efficiency. Any expression or script can be used to set the constant value, provided that the script resolves to the constant type. For example,
If constant type is selected as String, then the output must be a string.
If constant type is selected as Date, then the output must be a date.
The defined constants are considered similar to the fields, but their values cannot be changed. They appear in the EZscript Expression editor tree and can be referenced in any subsequent script similar to a field. The constants are resolved and evaluated before the TransformationStarted event and scripts have access to the available data at that point.
The following are a few use case scenarios for constants:
Performance improvement: A constant used in a target field is evaluated once instead of evaluating for every row of data and every event/action parameter.
User Convenience:
Within a map, if constant is used in multiple instances, then you can change the value only for one instance.
If a constant is renamed, it will be updated automatically for all the instances.
When you have to evaluate multiple scripts against a constant value determined at runtime.
Note:  Constants are not available in v9 compatible maps.