> 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/xml-and-json-operations/get-tag-value.md).

# Get Tag Value

This is a pre-built Action located under the **@Generic** Element. The functionality of this Action in Avo Assure is to fetch the tag value based on the input provided and store the result in a dynamic variable.

## Syntax

**Input Value**: `<Xml_input>;<path>`

{% hint style="info" %}
**Note**: You can manually provide the key path or generate it automatically using the **Data Path Builder** available for the XML input. The generated path can be used directly as the input for the Get Key Value action. To learn more, [click here](/avo-assure/actions/generic/xml-and-json-operations/get-tag-value/data-path-builder.md).
{% endhint %}

| Argument                           | Description                                                                       |
| ---------------------------------- | --------------------------------------------------------------------------------- |
| <p>\<Xml\_input><br>(Required)</p> | Provide the XML block or XML tags from which the tag value needs to be retrieved. |
| <p>\<path><br>(Required)</p>       | Provide the path of the tag to retrieve its value from the XML input.             |

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

| Argument                                 | Description                                                                      |
| ---------------------------------------- | -------------------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This dynamic variable stores the fetched key value from the XML body or XML Tag. |
| <p>\<Dynamic Variable><br>(Optional)</p> | This dynamic variable stores the status as True, False, or None.                 |

### Example: Retrieving a Tag Value from an XML Input Using Path

In this example, we explain how to retrieve a specific tag value from an XML input using the XML path.

* **Action**: Get Tag Value
* **Input Value**: \<Xml\_input>;CompanyData.Departments.Department\[3].deptId
  * The first argument (**\<Xml\_input>**) specifies the XML input from which the tag value is retrieved.
  * The second argument (**CompanyData.Departments.Department\[3].deptId**) specifies the XML path used to locate the required tag value.
  * The array index (**\[3]**) specifies the third Department tag in the XML structure.

<pre class="language-xml" data-overflow="wrap" data-expandable="true"><code class="lang-xml"><strong>//XML Body
</strong><strong>&#x3C;CompanyData> 
</strong>    &#x3C;Departments> 
        &#x3C;Department> 
            &#x3C;deptId>D001&#x3C;/deptId> 
            &#x3C;Name>HR&#x3C;/Name> 
        &#x3C;/Department> 
        &#x3C;Department> 
            &#x3C;deptId>D002&#x3C;/deptId> 
            &#x3C;Name>Finance&#x3C;/Name> 
        &#x3C;/Department> 
        &#x3C;Department> 
            &#x3C;deptId>D003&#x3C;/deptId> 
            &#x3C;Name>QA&#x3C;/Name> 
        &#x3C;/Department> 
    &#x3C;/Departments> 
&#x3C;/CompanyData>
</code></pre>

* **Output Value:** {DeptId};{Status}
  * The first output variable (**{DeptId}**) stores the retrieved tag value as **D003**.
  * The second output variable (**{Status}**) stores the execution result with the following possible values:
    * **True:** If the tag value is retrieved successfully.
    * **False:** If the tag path does not exist or the XML input is invalid.
* **Logical Explanation**: The **Get Tag Value** action takes the value from the **Input Value** column (**\<Xml\_input>;CompanyData.Departments.Department\[3].deptId**) and searches for the specified tag path in the XML input. The action navigates through the XML structure, accesses the third Department tag using index **\[3]**, retrieves the deptId value (**D003**), and stores it in the **{DeptId}** variable. The execution result is stored in the **{Status}** variable as **True**.

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


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/xml-and-json-operations/get-tag-value.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
