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.

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!".

If you change the string operation to Extract substring from string index with length, set the index to 7, and set the number of characters to extract to 4, the result should be "nice".

Note: This action is available only in engine v2. For more information on engine v2, see Upgrade workflows to engine v2.

Before you start 

Configure the Modify string action

The steps required to configure the action are given below. The Modify string action fields, buttons, and settings table describes all the required and optional configuration fields.

In the Designer page:

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

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

  4. Do one of the following:
    • 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.

  5. 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 string from which the substring that you want to copy or modify is extracted. Text
  Number of characters to extract

The number of characters contained in a substring that you want to extract.

Integer
  Index

The character index within the source string that marks the beginning of the substring.

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