Get Sub String

This pre-built action located under @Generic Element. The functionality of this action in Avo Assure is to extracts a specific part of a string based on a given index or range and saves the result in a dynamic variable.

Syntax

Input Value: <string>;<index OR range>

Argument
Description

<string > (Required)

It refers to a sequence of characters (letters, numbers, symbols) treated as text.

<index OR range > (Required)

The position from where user must get the string of actual output.

Note: For the above syntax if it declared as

  • Index: It will extract all the remaining string from specific declared index up to last index.

  • Input index should start from 0 till n

  • Range: A range that starts from the first character of the string and approaches the end will exclude the last item. To capture the required string, add an extra (total range+1) index to the range

Output Value

Argument
Description

<Dynamic Variable> (Required)

This variable stores a specific portion of a string.

<Dynamic Variable> (Optional)

This variable stores the status as true or false

Example 1:

Extract substring from Input Value Column (Software Engineer) using Index (4)

The Get Sub String action takes the value from the Input Value column (Software Engineer) and extracts the substring starting from the specified index (4). For the input string (Software Engineer), the resulting substring is (ware Engineer). The extracted substring is stored in the {Sub string} variable, while the operation status is stored in the {Status} with the following possible values:

  • True – if the substring is successfully extracted.

  • False – if the input is invalid

  • None/Blank: If the Input Value is missing or index is invalid.

Example 2 Extract substring from Input Value Column (Software Engineer) using range (9–17)

The Get Sub String action extracts a substring from the Input Value column (Software Engineer) based on the specified range (9–17). For the input string (Software Engineer), the substring (Engineer) within this range. The extracted substring is stored in the {Sub string} variable, while the operation status is stored in the {status} with the following possible values:

  • True – if the substring is successfully extracted or

  • False – If the input value is empty or an invalid index/range (out of bounds) is provided.

  • None/Blank: If the Input Value is missing or range is invalid.

Knowledge Bites: Below are some examples of different string scenarios

String
Input Value (syntax)
Result

Text Strings

Automation;4 (index) / 3-10 (range)

(mation) / (omation)

Numeric Strings

12345678; 4 (index) / 3-10 (range)

(5678) / (45678)

Special Character

[email protected]; 4 (index) / 3-10 (range)

(domain.com) / (@domain)

Alphanumeric strings

ID2025; 4 (index) / 3-6 (range)

(25) / (025)

Empty String

;3

0

Last updated

Was this helpful?