# Replace

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to replace a specified part of the input text with a given replacement text. The updated result is stored in a dynamic variable.

## **Syntax**

**Input Value**: `<actual string>;<string to be replaced>;<string to replace>`&#x20;

| Argument                                         | Description                                                            |
| ------------------------------------------------ | ---------------------------------------------------------------------- |
| <p>\<actual string></p><p>(Required)</p>         | Provide the actual string where the replacement should occur.          |
| <p>\<string to be replaced></p><p>(Required)</p> | Provide the string that needs to be replaced within the actual string. |
| <p>\<string to be replaced></p><p>(Required)</p> | Provide the new string that will replace the specified text.           |

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

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

### **Example:** Replacing a String with Another String

In this example, we explain how to replace a specific string with another string.

* **Action**: Replace
* **Input Value**: Michael Brown;Brown;Smith
  * The first argument (**Michael Brown**) specifies the original string.
  * The second argument (**Brown**) specifies the word to replace.
  * The third argument (**Smith**) specifies the new word that will replace the old one.
* **Output Value**: {Replaced value}
  * The updated string (Michael Smith) is stored in this **{Replaced value}** dynamic variable.
  * If the second output variable is defined, it stores the action status with the following possible values:
    * **True**: If the replacement is successful.
    * **False**: If the replacement fails due to invalid input or when the specified word to replace is not found.
* **Logical Explanation**: The **Replace** action fetches the value from the **Input Value** column (**Michael Brown;Brown;Smith**), replaces the string (Brown) with (Smith), and stores the updated string (Michael Smith) in the **{Replaced value}** dynamic variable.

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

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

Here are some examples of different string scenarios:

| String               | Input Value                | Result             |
| -------------------- | -------------------------- | ------------------ |
| Text Strings         | Blue World;World;Sky       | Blue Sky           |
| Numeric Strings      | 12345;23;98                | 19845              |
| Special Character    | <abc@domain.com>;abc;order | <order@domain.com> |
| Alphanumeric strings | ID8765;8765;2345           | ID2345             |


---

# 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/replace.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.
