# 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>`&#x20;

{% hint style="info" %}
**Note**:&#x20;

* 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.&#x20;

<figure><img src="/files/ckBf2cYqkmQytTwLhqnh" 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: 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/string-generation.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.
