> 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/string-generation.md).

# String Generation

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to generate a random string of the specified length. The extracted value is stored in the given dynamic variable for further use during test execution.

## **Syntax**

**Input Value**: `<type>;<length>`

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

* The following data types are supported:
  * **Char/char (Character)**: Generates alphabetic characters (A–Z, a–z).
  * **Num/num (Number)**: Generates numeric digits (0–9).
* The string type is not case-sensitive. For example, both **Char;9** and **char;9** are valid.
  {% endhint %}

| Argument                          | Description                                                                                                                     |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<type></p><p>(Required)</p>   | Provide the data type (Char/Num) for the string you want to generate.                                                           |
| <p>\<length></p><p>(Required)</p> | Provide the length of the random string to be generated. This defines how many characters or numbers the string should contain. |

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

| Argument                                    | Description                                                                                           |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| <p>\<Dynamic Variable></p><p>(Required)</p> | This dynamic variable stores the generated string.                                                    |
| <p>\<Dynamic Variable></p><p>(Optional)</p> | <p>This dynamic variable stores the status as <strong>True</strong><br>or <strong>False</strong>.</p> |

### **Example: Generating a String with Specific Type and Length**

In this example, we explain how to generate a string based on the specified type and length.

* **Action**: String Generation
* **Input Value**: char;4
  * The first argument (**char**) specifies the type of the string to generate an alphabetic string.
  * The second argument (**4**) specifies the length of the string to be generated.
* **Output Value**: {Generated String}
  * The generated string (e.g., axyX) is stored in this **{Generated String}** dynamic variable.
  * If a second output variable is provided, the action returns the status as **True** or **False**:
    * **True**: If the string generates successfully.
    * **False**: If the string generation fails due to blank input or configuration error.
* **Logical Explanation**: The **String Generation** action fetches the value from the **Input Value** column (**char;4**). This action generates a 4-character alphabetic string (e.g., axyX) and stores it in the **{Generated String}** variable.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F5gSpTBWZ2m3CGcCKeX1m%2Fimage.png?alt=media&amp;token=df38a1c4-0b18-4b7d-b9cb-31d9cd6075e6" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**

Here are some examples of different string scenarios:

| String Type | Input Value | Result   |
| ----------- | ----------- | -------- |
| Character   | char;8      | uESrOCsL |
| Number      | num;5       | 45689    |


---

# 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/string-generation.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.
