Transformation Function Reference

As you map header and payload values between your source and target systems, you might want to modify the source header or payload data so that it conforms to your target format. You can do this using transformation functions.

The following transformation functions are available for Self-Managed Connectors:

Function Name Parameters Returns Description

absoluteNumber

input (Number)—A number.

The absolute value of the input.

Returns the absolute (positive) value of a number. If the number is positive zero or negative zero, the result is positive zero. If the number is infinite, the result is positive infinity. If the number is NaN (Not a Number), the result is NaN.

ceilingNumberToDouble

input (Number)—A number to round up.

The ceiling of the input number.

Rounds up a number to the nearest whole value. The result is always a whole number, but is represented in a floating-point format. For example, the ceiling of 4.3 is 5.0 and the ceiling of -4.3 is -4.0. If the input is NaN (Not a Number), infinite, positive zero, or negative zero, then the returned value is the same as the input. If the input value is less than zero but greater than -1.0, then the result is negative zero.

concatString

inputs (String[])—An array of strings to be concatenated.

The concatenated string.

Concatenates an array of strings. If an element of the array is null, then the string "null" is added to the result.

convertBooleanToString

input (boolean)—A boolean to be converted to a string.

The string representing the input boolean value.

Converts a boolean value to a string. Returns "true" if the input value is true, and "false" if the input value is false.

convertNumberToString

input (Number)—A number to be converted to string.

The string representation of the input number.

Converts a number to the string representation of that number.

convertStringToNumber

input (String)—A string to be converted to a number.

The numeric representation of the input string.

Converts a string to a number. If the input string is not a valid number, this function produces an error. If the input is a string representation of a special number ("NaN", "Infinity", "-Infinity", or "-0"), then the result contains the corresponding numeric representation.

floorNumberToDouble

input (Number)—A number to round down.

The floor of the input value.

Rounds down a number to the nearest whole value. The result is always a whole number, but is represented in a floating-point format. For example, the floor of 4.3 is 4.0 and the floor of -4.3 is -5.0. If the input is NaN (Not a Number), infinite, positive zero, or negative zero, then the returned value is the same as the input.

joinString

delimiter (String)—The character or characters to insert between the elements being joined.

inputs (String[])—An array of strings to be joined.

The joined string.

Joins an array of strings with the specified delimiter. The delimiter can be multiple characters. If an element of the array is null, then the string "null" is added to the result.

lowerCaseString

input (String)—A string to be converted to lower case.

The lower-cased string.

Converts a string to lower case.

maskNumber

input (Number)—A number to mask.

mask (Number)—The mask to apply to the input number.

The masked number.

Masks a number by replacing it with the specified number. Note: The original value is not retrievable.

maskString

input (String)—A string to mask.

mask (String)—The mask to apply to the input string.

The masked string.

Masks a string by replacing it with the specified string. Note: The original value is not retrievable.

roundNumberToLong

input (Number)—A number to round.

The closest whole number to the input.

Rounds a number to the closest whole number. Values that have 0.5 as their fractional parts round toward positive infinity. If the input is NaN (Not a Number), the result is 0. If the input is negative infinity or any value less than or equal to the value of -2^63, the result is equal to the value of -2^63. If the input is positive infinity or any value greater than or equal to the value of (2^63)-1, the result is equal to the value of (2^63)-1.

splitString

input (String)—A string to split.

delimiter (String)—The delimiter to split the string by.

numSplits (Number)—The number of elements in the result array.

The array of splits.

Splits a string into the parts that are separated by the specified delimiter. The delimiter is not included in the result. If the input string does not contain enough splits to fill the result array, the remaining array elements contain empty strings. If the string contains more splits than the result array can hold, the last element of the result array contains the remaining substring.

substringString

input (String)—A string.

startIdx (Number)—The starting index of the substring.

length (Number)—The length of the substring.

The substring.

Extracts a substring from a string, based on a starting index and a length. An index of 0 denotes the first character of the string.

trimString

input (String)—A string to trim.

The trimmed string.

Removes the whitespace from both ends of a string.

upperCaseString

input (String)—A string to be converted to upper case.

The upper-cased string.

Converts a string to upper case.