# Get Block Count

This is pre-built Action located under the @Generic Element Name. It instructs the Avo Assure Client to fetch the total number of the blocks that are present in Input Value and save the result in the given output variable.

### **Syntax**

**Input:** `<XML block/XML tags>;<block name>`

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

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

### **Usecase/Example**

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

### **Scenario: Testing API Response for Transaction History**

You are working with a financial services API that is designed to provide users with their transaction history in XML format.

Consider a test case that involves sending a request to the API to retrieve the most recent 3 transactions for a specific user, identified by their user ID.

### **Input**

```
// xml
<transactions>
  <transaction>
    <date>2024-01-01</date>
    <amount>1000.00</amount>
    <transactionId>TXN12345</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:**

get block count Action will determine the number of \<transaction> blocks present in the XML response.

### **Expected Result**

This Action need to retrieve the count as 3 due to this XML block contains total 3 blocks in it.

### **Output**

The result of this action is stored in the {result} output variable as 3, which can be utilized for display or other purposes.


---

# 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-count.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.
