String transformation functions
The following table explains the string transformation functions that are available in BMC Helix Integration Studio:
Function | Description | Example |
---|---|---|
substring / substring() | Returns a part of the source string identified by start and end parameters.
Note: The function processes the character in the start position, but not the one in the end position. | If the source string is "integer", applying substring(0,2) returns "in". |
substr / substr() | Similar to substring(), except that you have start and length parameters.
| If the source string is "Integration", applying substr(1,2) returns "nt". |
words / words() | Returns the source string or a part of the source string as a collection of words. It has the following parameters: start, end, separator, and join.
Note: The function processes the character in the start position, but not the one in the end position. | If the source string is "hard!to!read!", applying words(5,11,!) returns "to read". |
lines / lines() | Returns the source string or a part of the source string as a collection of lines. The implicit \n character is used to split lines.
Note: The function includes the character in the start position, but not the one in the end position. | If the source string is: "This is line 1. Then applying lines(17) returns: "This is line 2. |
replace / replace() | Returns the source string after replacing a matching value.
| |
toUpperCase / toUpperCase() | Converts and returns the source string in all uppercase letters. This function has no parameters. | If the source string is "some text", applying toUppercase() returns "SOME TEXT". |
toLowerCase / toLowerCase() | Converts and returns the source string in all lowercase letters. This function has no parameters. | If the source string is "SOME TEXT", applying toLowercase() returns "some text". |
capitalize / capitalize() | Converts and returns the source string with the first letter in all words capitalized. This function has no parameters. | If the source string is "some text", applying capitalize() returns "Some Text". |
stripHtml() | Removes the HTML tags used for text formatting to send plain text to a target system. Use this function if the HTML markup is not supported in a target application of your flow. This function has no parameters. | If the source string is: "This is a text from a JIRA comment:
Then applying stripHtml() returns: "This is a text from a JIRA comment: some text 1 some text 2". |
isEqual(value) / isNotEqual(value) | Sets the boolean fields in a target application to True or False. You must configure the parameters in one of the following ways:
Note: This function is available only for the boolean fields and is hidden for the other fields. |
|
currentTime() | Sets the current time as a timestamp for the fields of the following data type:
For the datetime, date, and time fields, the value is the appropriate string representation of the current time. For integer fields, the value is the number of seconds since January 1, 1970 (epoch date). | If the source time is "16:00:05", and the current time is "17:01:01", applying currentTime() returns "17:01:01". |
formatDate(<format string>, [timezone]) | Formats values to a specified string format for the fields of the following data type:
Optionally, you can specify a timezone to convert a value according to the timezone before formatting the value into the string. | If the source date is "11/12/2019", applying formatDate(yyyy-mm-dd) returns "2019-12-11". |
getValueAt(<index>) | Extracts a value from a string array at a specified index under the following conditions:
| If the source string array is "some text is written here", applying getValueAt(2) returns "text". |
insertValueAt(<index>, <string>) | Inserts a value at the start, at the end, or at a specified index into a string array under the following conditions:
| If the source string array is "some text is written here", applying insertValueAt(-1,with high importance) returns "some text is written here with high importance". |
updateDateTime(value) | Adds additional time, in minutes, to the DateTime value. You can add any positive or negative integer. | If the source time is "11/12/2019:16:00:05", applying updateDateTime(120) returns "11/12/2019:18:00:05". where 120 mins is equal to 2 hours. |