# Get Block Value

This is pre-built Action located under the @Generic Element Name. It instructs the Avo Assure Client to fetch the value of the XML block and save the result in the given output variable.

### **Syntax**

**Input:** `<XML tag name>;<index of block name> ; <block name>`

**Output:** `<Dynamic Variable>;<Dynamic Variable>(Optional)`&#x20;

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

### **Usecase/Example**

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

### **Scenario:** **Fetching Values from XML Blocks in API Testing**

When you are testing a financial services API that returns a user's transaction history in XML format. It's important to verify that not only the correct number of transaction blocks is returned, but also that the values within those blocks are accurate.

Consider that you send a request to the API to retrieve the latest 4 transactions for a specific user and want to extract specific block values from the XML response. In this scenario user wants to fetch the value of 2 child blocks from parents block by providing parents block name.

### **Input**

```
// xml
<transactions>
  <transaction>
    <date>2024-10-01</date>
    <amount>100.00</amount>
    <transactionId>TXN12345</transactionId>
  </transaction>
  <transaction>
    <date>2024-09-30</date>
    <amount>150.00</amount>
    <transactionId>TXN12344</transactionId>
  </transaction>
  <transaction>
    <date>2024-02-18</date>
    <amount>1200.00</amount>
    <transactionId>TXN76543</transactionId>
  </transaction>
  <transaction>
    <date>2024-03-01</date>
    <amount>1080.00</amount>
    <transactionId>TXN67890</transactionId>
  </transaction>
</transactions>
```

**Using the Action:**

You will use the get value Action to extract specific values from the XML blocks, such as the 2 transaction blocks.

### **Expected Result**

This Action needs to retrieve two child blocks from the desired parent block by providing parents block name.

### **Output**

The result of this Action is stored in the {result} output variable&#x20;

```
<transaction>
 <date>2024-09-30</date>
 <amount>150.00</amount>
 <transactionId>TXN12344</transactionId>
</transaction>
```


---

# 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/xml-and-json-operations/get-block-value.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.
