Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Create a script for a transform definition

Log in to subscribe to topics and get notified when content changes.

Create a script for a transform definition

Create the script at any time during the configuration of a definition.

About this task

The script can perform a transform action without using a variable, but the action of the definition will be the same for all fields. Variables create more flexibility for the definition, enabling an administrator to use the same definition in different ways in different places. If a variable is defined, the script must reference the variable using the correct format.

There are three arguments in the script:

  • Variables: Contains the variables using the format variables.<variable name>.
  • Value: Contains the un-transformed value
  • Parameters: Special objects that set debug messages.


  1. Open the Odd/Even record in the Transform Definitions module.
  2. Enter the following script to pass values with the odd_even variable.
    function(variables, value, parameters) {
    	var odd = ('odd' == variables.odd_even);
    	var val = value - 0;
    	var val_odd = ((val & 1) == 1);
    	if (odd != val_odd)
    	return '' + val;

    Notice that the script references the variable in the form variables.odd_even.

    Column named referenced in variable
  3. Update the record to complete the configuration.

    The Odd/Even transform definition is now ready to use in a field transformation.