# Compare Inputs

This is pre-built Action located under the **@Generic Element,** instructs the Avo Assure to compare the inputs specified in the input Value (.xml and .json content) and save the differences in dynamic variable.

### **Syntax**

**Input Value:** `<Input Text(Original)>;<Input Text(Changed)>;<Selective/All(Optional)>`&#x20;

| Argument                                         | Description                                                                                                                |
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| <p>\<Input Text (Original)></p><p>(Required)</p> | Provide original input you want to compare against.                                                                        |
| <p>\<Input Text (Changed)><br>(Required)</p>     | The new or expected text value that you want to be compared.                                                               |
| <p>\<Selective/All(Optional)><br>(Optional)</p>  | <p>Optional comparison mode:<br>• All → compares the entire text exactly<br>• Selective → compares only specific parts</p> |

**Output Value:**&#x20;

| Argument                                 | Description                                               |
| ---------------------------------------- | --------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This variable holds the result of the content comparison. |
| <p>\<Dynamic Variable><br>(Optional)</p> | This variable stores the status as **true** or **false**  |

{% hint style="warning" %}
**Note:** Outputs for compare files and compare Inputs are as follows:

* &#x20; JSON and text:
* \- If a line is removed from the first input
* \+ If a line is added in the second input
* ? shows the delta (difference) of the two files
* &#x20;xml: \ tags will be there with the following params:
* diff:update-attr – XML attribute is updated
* diff:delete- line deleted
* diff:insert- line inserted
* diff:delete-attr- attribute deleted
* diff:add-attr- XML attribute added
  {% endhint %}

**Example**

**Compare two input texts and highlight differences**\
\
The **Compare Inputs** action takes the value from the Input Value column (e.g., **{"name":"Alice","age":30,"email":"<alice@example.com>"};{"name":"Alice","age":28,"email":"<alice@example.com>"};all**) and compares the original input text with the changed input text. The result of the comparison is stored in the **{Comparison}** variable, and the action status is saved in the **{Status}** variable with the following possible values:

* **True** – if the inputs are compared successfully
* **False** – if the inputs are not compared&#x20;

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

{% hint style="warning" %}
**Note:** After executing the Test Steps you can see the result in the Avo Assure Client console.
{% endhint %}

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


---

# 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/file-and-folder-operations/compare-inputs.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.
