Transform function reference (services)
Field transformation function types
Common
Transformation | Description | Input Value | Transform Value | Output Value |
---|---|---|---|---|
Custom Value (True or False) | Enter a customer value as True/False (Boolean) | TRUE | TRUE | |
Custom Value (Date) | Enter a customer value as Date (DateTime) | 01/13/2022 | 01/13/2022 | |
Custom Value (Number) | Enter a customer value as Number (Integer) | 123 | 123 | |
Custom Value (Text) | Enter a customer value as Text (String) | Example | Example | |
Get Date | Return the current datetime | (Todays Date) | ||
Get Unique Ref | ||||
Random Number | Return a random number at a specified length | 5 | 98765 | |
Run Custom Script | Run an existing custom script | Selected script | Script return vaulue | 5 |
Text (String)
Transformation | Description | Input Value | Transform Value | Output Value |
---|---|---|---|---|
Contains | Check if a string contains text | Example String | "stri" | TRUE |
Decode (URL) | Convert an encoded URL into a readable format | example%20string | Example String | |
Encode (URL) | Convert a string to a URL encoded string | Example String | example%20string | |
First Word | Get the first word from a string | Adam David John Smith | Adam | |
Get Country Code | Return the country code for a country name | Germany | 12 | |
Get Country Name | Return the country name for a country code | 12 | Germany | |
Hash | Convert a string to a SHA1 Hash | Example String | 77077529426442283f684c6732a765801f938f94 | |
Last Word | Get the last word from a string | Adam David John Smith | Smith | |
Lowercase | Convert a string to lowercase | Example String | example string | |
Max Length | Set the maximum number of returned characters | Example String | 10 | Example St |
Middle Words | Get the middle word(s) from a string | Adam David John Smith | David John | |
Pad | Add characters before,around,after a string | Example String | Both, 18, X | XXExample StringXX |
Prefix | Add a string to the beginning | Example String | TEST | TESTExample String |
Propercase | Uppercase the first letter in each sentence | EXAMPLE STRING | Example string | |
Remove | Remove a string | Example String | ample | Ex String |
Clean string | (i) Remove or replace special characters in a string | $_Example String! | replace = X | X_ExampleXStringX |
(ii) Remove all non-alphanumeric characters in a string | $_Example String! | alphanumeric_only = true | ExampleString | |
(iii) Replace all non-alphanumeric characters in a string | $_Example String! | alphanumeric_only = true replace = X | XXExampleXStringX | |
Replace | Replace any characters with another | Example String | e, X | XxamplX String |
Substring (After) | Return characters after a value | Example String | pl, 5 | e Str |
Substring (Before) | Return characters before a value | Example String | pl, 5 | Exam |
Substring (Between) | Return characters between a two values | Example String | pl, g | e Strin |
Substring (Range) | Return characters within a range | Example String | "3 , 7 | mpl |
(i) Using negative values allows you to return the end of a string | Example String2 | "-1, -4 | ing2 | |
Suffix | Add a string to the end | Example String | Test | Example StringTest |
Trim | Remove any characters around a string | xExample Stringxx | Both, x | Example String |
Uppercase | Convert a string to uppercase | Example String | EXAMPLE STRING |
Number (Integer (123) / Float (123.456))
Transformation | Description | Transform Value | Output Value | |
---|---|---|---|---|
Calculate matching key | Perform a simple calculation (+ - / *) | 123 | "/ , 5 | 24.6 |
Ceiling | Round up to the nearest whole number | 24.4 | 25 | |
Convert Weight | Convert a weight (mg, g, kg, lb, oz) | 25 | kg, g | 25000 |
Floor | Round down to the nearest whole number | 24.6 | 24 | |
Reverse Sign | Convert a negative number to a positive number or vis versa | 24.6 | -24.6 | |
Round | Round to specified number of decimal places | 12.34567 | 2 | 12.34 |
To Negative | Return a negative value | -24 | -24 | |
To Positive | Return a positive value | -24 | 24 |
Boolean (True/False)
Transformation | Description | Input Value | Transform Value | Output Value |
---|---|---|---|---|
Reverse | Convert a negative to a positive or vis versa | TRUE | FALSE |
Date / DateTime
Transformation | Description | Input Value | Transform Value | Output Value |
---|---|---|---|---|
Adjust Date | Add or Subtract units (Seconds, Minutes, Hours, Days, Weeks, Months, Years) | 4/Jul/2022 | + , 100, Days | 12/Oct/2022 |
Convert Date | Convert a date to another timezone / format | 4/Oct/2022 12:00 | gmt > hk, dd-MMMM-yy | "04-October-22 20:00 |
Convert to String | Convert a date to a string | 4/Oct/2022 12:00 | y/m/d | 2022/10/4 |
Date Comparison | Check if a date is before/equal/after | 4/Jul/2022 | Before, 10/Jul/2022 | TRUE |
Date Diff | Return the difference between 2 dates | 4/Jul/2022 | 15/Jul/2022, days | 14 |
c