Get Sub String
Last updated
Was this helpful?
Last updated
Was this helpful?
The Get Sub String action in Avo Assure, found under @Generic Element, 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>
<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
<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
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 within this range is (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
Knowledge Bites: Below are some examples of different string scenarios
Text Strings
Automation; Index (4) / Rang (3-10)
( mation ) / (omation)
Numeric Strings
12345678; Index (4) / Rang (3-10)
(5678) / (45678)
Special Character
abc@domain.com; Index (4) / Rang (3-10)
(domain.com) / (@domain)
Alphanumeric strings
ID2025; Index (4) / Rang (3-6)
(25) / (025)