> 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-block-count.md).

# 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)`

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