Modify string
Use the Modify string action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. to perform basic string operations, such as trimming strings, and extracting, finding, and replacing substrings. You can select the string operation required when configuring the action.
For example, you can use the Modify string action and select the string operation called Replace substring in string to change the source string Hello, it's a nice day! to Hello, it's a beautiful day!.
For the same source string if you use the string operation Extract substring from string index with length, set the Index to 14, and set the Number of characters to extract to 4, the result of the action will be nice. The Extract substring from string index with length string operation extracts the specified number of characters from the source string. The characters to extract is specified in the Number of characters to extract field. The first character is at index zero.
Configure the Modify string action
-
Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.
- From the String operation drop-down list, select a String operation.
-
In the Source string field, specify the Source string.
- Complete one of the following tasks:
To extract a substring from the start or end of a string , specify the Number of characters to extract.
To extract a substring from a string index, specify the Index.
To extract a substring from a string index with length, specify the Index and Number of characters to extract.
To find a substring in a string, specify the Substring.
To replace a substring in a string, specify the Substring and Replacement substring.
-
In the Result field, select or add a variable where you want to store the result of the string operation.
Note: The fields that appear depend on the string operation you select.
Modify string action fields, buttons, and settings
Section |
Field |
Description |
Variable types |
---|---|---|---|
Unlabeled | String operation |
A list of string operations.
Note: The fields that appear depend on the string operation you select. |
n/a |
Source string | The source string to use for the string operation. | Text | |
Number of characters to extract |
The number of characters that you want to extract from the source string. |
Integer | |
Index |
The character index within the source string that marks the beginning of the substring.The first character is at index zero. |
Integer | |
Substring | The string that you want to find or extract from a source string to be copied or modified. | Text | |
Replacement substring | The new string that you want to replace the substring with. | Text | |
Output | Result | A variable where you can store the result of the string operation. | Text |