> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/generic/string-operations/get-string-length.md).

# 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>`

{% 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="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FWL9oh8MR6ikuOIPH1j9y%2Fimage.png?alt=media&amp;token=656d45cc-f4f3-4174-9210-61b95f4f0630" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
