String manipulation methods reference
This topic describes workflow elements that can be used for manipulation of string input and passing the manipulated string output to another element in a workflow.
String manipulation activities overview
Workflow designer provides a set of string manipulation activities grouped together on the Palette, in the String Utils section.
The following screenshot shows the String Utils workflow activities and a simple example of a workflow in which one of these activities is used:
This topic provides a full reference of the available string manipulation elements:
Index Of
Returns the first index within a search string in a specified text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Search Characters | Required | String | String to search for. | |
Start Position | Optional | Integer | Start position of the text to search from. | |
Output | Output | Not applicable | Integer | The first index within the Search Characters string found in the Text string starting from the position specified by the Start Position value. Returns -1 if the specified search characters are not found in the text. |
Last Index Of
Returns the last index within a search string in a specified text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Search Characters | Required | String | String to search for. | |
Start Position | Optional | Integer | Start position of the text to search from. | |
Output | Output | Not applicable | Integer | The last index within the Search Characters string found in the Text string starting from the position specified by the Start Position value. Returns -1 if no match is found. |
Insert
Inserts a string in a specified text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Offset | Optional | Integer | The distance between the beginning of the text and a string to be inserted. The offset argument must be greater than or equal to 0, and less than or equal to the length of this sequence. | |
Insertion | Required | String | Text to insert. | |
Output | Output | Not applicable | String | The text with inserted string. |
Json Parser
Retrieves a string from a specified Json.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Json | Required | Array | Json string. |
Path For Search | Required | String | A path from the Json string to retrieve. For information about syntax for this field, see
JsonPath syntax
| |
Limit | Optional | Integer | 1 is the default value. | |
Output | Output | Not applicable | String | Retrieves the specified string from the Json. |
For an example workflow, see Using the Json Parser string manipulation method to retrieve information.
Length
Counts the character length of a specified text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input string text. |
Output | Output | Not applicable | Integer | A count of characters in a specified input string. |
Matches
Matches a regular expression against an input string.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Regexp | Required | String | Regular expression to search for. | |
Output | Output | Not applicable | Integer | Returns 1 if true, and 0 if false. |
Replace
Replaces all occurrences of a string within another string.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Text to search and replace in. Can be empty. |
Search Text | Required | String | Search string to search for. | |
Replacement | Required | String | String to replace it with. | |
Output | Output | Not applicable | String | The text with replacements. |
Replace All
Replaces every substring of a text string that matches the given regular expression with the given replacement.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | The text to modify. |
Regexp | Required | String | Regular expression matching the text to be replaced. | |
Replacement | Required | String | Replacement string to be substituted for each match. | |
Output | Output | Not applicable | String | The text with any processed replacements. |
Substring
Retrieves a substring from a specified text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Text to search in. |
Start Position | Optional | Integer | The position to start from. A negative start position can be used to start characters from the end of the string. | |
End Position | Optional | Integer | The position to end at. | |
Output | Output | Not applicable | String | A string between a specified start position and end position retrieved from the input text. |
To Upper Case
Converts input text string to uppercase text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Output | Output | Not applicable | String | Converted text. |
To Lower Case
Converts input text string to lowercase text.
Parameter type | Parameter name | Required | Data type | Description |
---|---|---|---|---|
Input | Text | Required | String | Input text. |
Output | Output | Not applicable | String | Converted text. |
Example: Workflow that uses the Json Parser activity
The following example shows how the Json Parser method is used in a workflow.
The Send HTTP Request activity sends its Json output to the Json Parser activity. The Json Parser activity searches for the Json string that the Json Path defines, and sends no more than three returned Json strings (the limit defined in the Limit parameter) to the Send In App notification activity.
You can save a copy of a service that uses this workflow, export it to your environment, and see how it works.
Comments
Log in or register to comment.