Modify string

Use the Modify string action A tool for building the processes, logic, and direction within workflows. 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

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.

  2. From the String operation drop-down list, select a String operation.
  3. Note: The fields that appear depend on the string operation you select.

  4. In the Source string field, specify the Source string.

  5. 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.

  6. In the Result field, select or add a variable where you want to store the result of the string operation.

Modify string action fields, buttons, and settings

Section

Field

Description

Variable types

Unlabeled String operation

A list of string operations.

  • Extract substring from start of string - Copies a specified number of characters starting from the beginning of a string and stores the output in a variable.

  • Extract substring from end of string - Copies a specified number of characters starting from the end of a string and stores the output in a variable.

  • Extract substring from string index - Copies a substring starting at a specified index in the string and stores the value in a variable.

  • Extract substring from string index with length - Copies a substring comprising a specified number of characters, starting at a specified index in the string, and stores the value in a variable.

  • Find substring in string - Finds a particular substring inside a string and returns the index of the substring's starting position.

  • Replace substring in string - Replaces a particular substring with another substring.

  • Trim string - Removes white spaces from the beginning and end of a string.

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