String Operations

The String Operations action allows you to perform string operations within your flow.

The String Operations action on a blank board

You might use the String Operations action to:

  • Determine account type based on digits of an account number (using the Substring operation)

  • Distinguish between a credit card or debit card during a transaction (using the First operation)

  • Create the full dial string (using the Concat operation)

 

Supported operations include:

  • Substring: Extract a specific part of the string

  • Position: Find the first occurrence of a character or character set

  • Length: The number of characters in the string

  • First: Returns the first character or character set in the string (e.g., extract the first two characters of the string)

  • Last: Returns the last character or character set in the string (e.g., extract the last five characters of the string)

  • Concat: Link two strings together to form one new one

 

Check out the video below to learn more about using strings within your flow.

 

Available Variables

Available Variables are placeholders for information that are automatically determined based on the contents of your flow. For example, if your flow begins with an Inbound Call trigger, the caller’s phone number is stored as a $ANI variable. You can include sending a follow up SMS to the caller later in your flow by including the $ANI variable in the Send SMS action Inputs.

You can drag and drop the variables displayed in this section into the Inputs and Advanced fields.

Check out How to Use Variables in SmartFlows for more information.

 

Inputs

Configure the following inputs to set up this action. The available inputs vary depending on the selected Operation.

Input Name

Description

Operation*

Select the string operation you want to perform from the drop-down list. *This is a required field.

 

Substring Inputs

Input Name Description
Input* String content. This can be a variable or the string itself. *This is a required field.

Does your input contain commas?

If your Input includes commas, click this check box to ensure the commas aren't misinterpreted.

Starting Index Position*

Where the subset of the string begins. Include an integer value. *This is a required field.

Note: SmartFlows begins counting at 0. Therefore the first index position for all strings in a flow is considered position 0. Any integer after that is positive (e.g., if our string is "ABCD...", index position 0=A, index position 1=B, index position 2=C, etc.).

Number of Characters How many characters will be included in the subset of the string. Must be one or greater, or blank.
SetVar Configure a custom variable for the result of your string operation. If you don't set a custom variable the default is ${Action_ID}.Result (e.g., $STRING_OPERATIONS_7.Result).

 

Position Inputs

Input Name Desription
Input* String content. This can be a variable or the string itself. *This is a required field.

Does your input contain commas?

If your Input includes commas, click this check box to ensure the commas aren't misinterpreted.

Character(s)* The character or character set you want to find. *This is a required field.

Does your character input contain commas?

If your entry in the Character(s) field includes commas, click this check box to ensure the commas aren't misinterpreted.

SetVar Configure a custom variable for the result of your string operation. If you don’t set a custom variable the default is ${Action_ID}.Result (e.g., $STRING_OPERATIONS_7.Result).

 

Length Inputs

Input Name Description
Input* String content. This can be a variable or the string itself. *This is a required field.

Does your input contain commas?

If your Input includes commas, click this check box to ensure the commas aren't misinterpreted.

SetVar Configure a custom variable for the result of your string operation. If you don’t set a custom variable the default is ${Action_ID}.Result (e.g., $STRING_OPERATIONS_7.Result).

 

First and Last Inputs

Input Name

Description

Input*

String content. This can be a variable or the string itself. *This is a required field.

Does your input contain commas?

If your Input includes commas, click this check box to ensure the commas aren't misinterpreted.

Number of Characters*

The amount of characters to include (e.g., to extract the first two characters of the string you would use "2" here). Must be a positive integer. *This is a required field.

SetVar

Configure a custom variable for the result of your string operation. If you don’t set a custom variable the default is ${Action_ID}.Result (e.g., $STRING_OPERATIONS_7.Result).

 

Concat Inputs

Input Name

Description

Input 1*

First string content. This can be a variable or the string itself. *This is a required field.

Input 2*

Second string content. This can be a variable or the string itself. *This is a required field.

Does your input contain commas?

If your Input includes commas, click this check box to ensure the commas aren't misinterpreted.

SetVar

Configure a custom variable for the result of your string operation. If you don’t set a custom variable the default is ${Action_ID}.Result (e.g., $STRING_OPERATIONS_7.Result).

 

Note: String operations within this action use zero-based indexing. The first item is assigned the starting index "0".

 

Action

Each String Operations action includes two exit ports corresponding to the following outcomes:

  • On Success: The course of the flow if the string operation is successfully performed (port 1)

  • On Error: The course of the flow if the string operation is not successfully performed (port 2)

An action must be connected to each of the exit ports to deploy your flow and the port order cannot be rearranged.