# Get String Length

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to count the total number of characters in the given input text. The character count is then stored in a dynamic variable.

## **Syntax**

**Input Value**: `<string>`&#x20;

{% hint style="info" %}
**Note**:

* The string count starts from the 1st index.
* The string length includes all characters in the input text, including spaces.
  {% endhint %}

| Argument                       | Description                                 |
| ------------------------------ | ------------------------------------------- |
| <p>\<string><br>(Required)</p> | Provide the string to calculate its length. |

**Output Value**: `<Dynamic Varibale>;<Dynamic Variable>(Optional)`

| Argument                                     | Description                                                                 |
| -------------------------------------------- | --------------------------------------------------------------------------- |
| <p>\<Dynamic Variable></p><p>(Required)</p>  | This dynamic variable holds the calculated string length (as a number).     |
| <p>\<Dynamic Variable></p><p>(Optional) </p> | This dynamic variable stores the operation status as **True** or **False**. |

### **Example:** Getting the Length of a String

In this example, we explain how to calculate the total number of characters in a string, including spaces.

* **Action**: Get String Length
* **Input Value**: SAP is one of the most widely used ERP systems across industries.
  * This specifies the string whose total length (including spaces) need to count.
* **Output Value**: {String Len}
  * The total count of characters (65) is stored in this **{String Len}** dynamic variable for further use.
  * If the second output variable is defined, it stores the action status with the following possible values:
    * **True**: If the string length is successfully calculated.
    * **False**: If the operation fails due to an invalid or empty input string.
* **Logical Explanation**: The **Get String Length** action fetches the value from the **Input Value** column (**SAP is one of the most widely used ERP systems across industries**) and counts all characters, including spaces. The total length (65) is then stored in the **{String Len}** variable.

<figure><img src="/files/GdUHVa4ehhYU1CDRFSWU" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**&#x20;

Here are some examples of different string scenarios:

| String               | Input Value          | Result |
| -------------------- | -------------------- | ------ |
| Text Strings         | Automation Framework | 20     |
| Numeric Strings      | 123456               | 6      |
| Special Character    | <abc@domain.com>     | 14     |
| Alphanumeric strings | ID202556             | 8      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/string-operations/get-string-length.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
