Mid

This pre-built action located under @Generic Element. The functionality of this action in Avo Assure is to extracts the middle character of a given input string and store the result in a dynamic variable.

Syntax

Note: If the input string has even number of characters, then it returns the mid+1 [(length/2) + 1] value.

Input Value: <string>

Argument
Description

<string>

(Required)

Provide the string from which the middle character will be extracted.

Output Value:

Argument
Description

<Dynamic Variable>

(Required)

This variable holds the extracted middle character.

<Dynamic Variable>

(Optional)

This variable stores the status as true or false

Example 1:

Extracting the Middle Characters from a String Using the Mid Action The Mid action takes the value from the Input value column (Johnson) and extracts the middle character(s) from the string. The extracted middle portion of the string is stored in the {Mid value} variable, while the operation status is stored in the {status} variable with the following possible values:

  • True – if the substring is successfully extracted

  • False – if the specified position is invalid or the input is empty

  • None/Blank: If the input value is missing.

Example 2:

Extracting the Middle Characters from an Even-Length String.

The Mid action takes the value from the Input Value column (Emma) and extracts the middle character from the string. Since the string has an even number of characters (4), the action returns the character at the mid+1 position.

The extracted middle portion of the string (m) is stored in the {Mid String} variable, while the operation status is stored in the {Status} variable with the following possible values:

  • True – if the substring is successfully extracted

  • False – if the specified position is invalid or the input is empty

  • None/Blank – if the input value is missing

Process: The string length is even; the action fetches the character at mid+1 position.

  • Length = 4

  • Middle = 4 ÷ 2 = 2

  • mid+1 = (2+1) 3 → character at position 3 is "m"

String
Input Value (syntax)
Result

Text Strings

Automation

a

Numeric Strings

123456

4

Special Character

a

Alphanumeric strings

ID2025

0

Even-Length String

User

e

Last updated

Was this helpful?