Text Operations
Use this action to perform text operations.
Using Text Operations Action
To use this action in your workflow, connect it to ThingWorx Flow. To connect to the flow, do the following:
1. Click and drag the Text Operations action under the Operations utility to the canvas, place the pointer on the action, and then click or double-click the action. The Text Operations connection window opens.
2. Edit the label name, if needed. By default, the label name is same as the action name.
3. To add an operation, select a text operation:
Split—Splits the input text with the separator specified by the user.
Trim—Removes leading and trailing white spaces from the input text.
Match—Matches the specified text or regex with the specified input text.
Replace—Replaces a pattern with the specified word.
Capitalize—Capitalizes the first letter of the specified input text.
LowerCase—Converts the specified input text to lowercase.
UpperCase—Converts the specified input text to uppercase.
Convert to Base64—Encodes the specified input text in Base64 format.
Escape HTML Entities—Converts the characters &, <, >, ", and ' to their corresponding HTML entities.
Unescape HTML Entities—Converts the HTML entities to their corresponding characters.
URL Encode—Encodes the given text string as a valid Uniform Resource Identifier (URI) format.
URL Decode—Gets the decoded version of the given URI format string.
Substring—Gets the substring from the given input string.
IndexOf—Returns the position of the first occurrence of the specified substring from the given text.
Decode Base64—Decodes the specified Base64 formatted input text.
Deburr—Deburrs input text by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks.
Pad—Pads input text on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
4. Specify the input text and enter values in the other fields as per the selected operation.
5. Click Done.
Using the Split Text Operation
Use this operation to split the input text with the separator specified by the user. To use the Split Text Operation, enter the following details:
1. Input—The input text on which to perform the split operation such as ‘John,Sansa,Aarya’
2. Separator—Separator value to split input. If the separator is a regex, then do not include opening and closing escape.
3. Separator is Regex—Specify if the entered separator is a plain text or regex. By default, the value is set to false.
4. Click + to view the additional fields, and then enter the following details.
Separator Regex Modifier— Select the regex modifier for the specified separator. It only appliedThe value for this field is considered only if the Separator is Regex field is set to true.
5. Click Done.
Using the Trim Text Operation
Use this operation to remove leading and trailing whitespaces from the input text. To use the Trim Text Operation, in the Input field, enter the input text that you wish to trim. and click Done.
Using the Match Text Operation
Use this operation to match the specified text or regex with the specified input text. To use the Match Text Operation, enter the following details:
1. Input—The input text on which to perform the match operation.
2. Match Regex—The regex pattern to match against the specified input text.
3. Click + to view the additional fields, and then enter the following details.
Regex Modifier—Select the separator regex modifier for the specified regex pattern.
4. Click Done.
Using the Replace Text Operation
Use this operation to replace a pattern (sequence of words) with the specified word. To use the Replace Text Operation, enter the following details:
1. Input—The input text on which to perform the replace operation.
2. Pattern—The pattern (sequence of words) to replace. You can enter this pattern as plain text or in the form of regex.
3. Pattern is Regex—Specify if the pattern is a regular expression.
4. Click + to view the additional fields, and then enter the following details.
Pattern Regex Modifier field, specify the regex modifier for the specified regex pattern. The value for this field is considered only if Pattern is Regex field is set to true.
Replace With—The value with which you want to replace the specified pattern. Keep this field empty in case you want to delete the specified pattern instead of replacing it with other words.
5. Click Done.
Using the Capitalize Text Operation
Use this operation to capitalize the first character of a string to uppercase and the remaining characters to lower case. To use the Capitalize Text operation, in the Input field, enter the input text you want to capitalize and click Done.
Using the LowerCase Text Operation
Use this operation to covert the specified input text to lowercase. To use the LowerCase Text operation, in the Input field, enter the input text you want to convert to lowercase and click Done.
Using the UpperCase Text Operation
Use this operation to covert the specified input text to uppercase. To use the UpperCase Text operation, in the Input field, enter the input text you want to convert to uppercase and click Done.
Using the Convert To Base64 Text Operation
Use this operation to encode the specified input text in Base64 format. To use the Convert To Base64 Text operation, in the Input field, enter the input text you want to encode in Base64 format and click Done.
Using the Escape HTML Entities Text Operation
Use this operation to convert the characters &, <, >, ", and ' to their corresponding HTML entities. To use the Escape HTML Entities Text operation, in the Input field, enter the input text you want to convert to their corresponding HTML entities and click Done.
Using the Unescape HTML Entities Text Operation
Use this operation to convert the HTML entities to their corresponding characters. For example, this operation converts HTML entities &, <, >, ", and ' in string to their corresponding characters. To use the Unescape HTML Entities Text operation, in the Input field, enter the HTML entities you want to convert to their corresponding text characters, and then click Done.
Using the URL Encode Operation
Use this operation to encode the given text string as a valid Uniform Resource Identifier (URI) format. To use the URL Encode operation, in the Input field, enter the input text you want to encode, and then click Done.
Using the URL Decode Operation
Use this operation to get the decoded version of the given URI format string. To use the URL Decode operation, in the Input field, enter the input text to get the decoded version, and then click Done.
Using the Substring Operation
Use this operation to get the substring from the given input string. To use the Substring Operation, enter the following details:
1. Input—The input text on which to perform the Substring operation.
2. Start Position—The desired start position of the substring.
3. End Position—The desired end position of the substring.
4. Click Done.
Using the IndexOf Operation
Use this operation to get the substring from the given input string. To use the IndexOf operation, enter the following details:
1. Input—The input text on which to perform the IndexOf operation.
2. Search for—Enter the search for text.
3. Click Done.
Using the Decode Base64 Operation
Use this operation to decode the specified Base64 formatted input text. To use the Decode Base64 operation, in the Input field, enter the input text you want to decode and then click Done.
Using the Deburr Operation
Use this operation to deburr the input text by converting Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removing combining diacritical marks. To use the Deburr Operation, in the Input field, enter the input text to deburr and then click Done.
Using the Pad Operation
Use this operation to pad the input text on the left and right sides if it's shorter than length. To use the Pad operation, enter the following details:
1. Input—The input text on which to perform the Pad operation.
2. Padding Length—Specify the required padding length.
3. Click + to view the additional fields
String to Pad—Enter the string that you want to pad.
4. Click Done.
Output Schema
The Text Operations action returns an output schema as shown in the figure that follows:
Was this helpful?