> 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-1.md).

# Get Block Count

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

### **Syntax**

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

| Argument                                   | Description                                                             |
| ------------------------------------------ | ----------------------------------------------------------------------- |
| <p>\<XML block/XML tags><br>(Required)</p> | Specify the XML block or tags to retrieve the block count.              |
| <p>\<block name><br>(Required)</p>         | Provide name of the XML tag/block whose occurrences need to be counted. |

**Output Value:**

| Argument                                 | Description                                              |
| ---------------------------------------- | -------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This variable stores the number of XML blocks or tags.   |
| <p>\<Dynamic Variable><br>(Optional)</p> | This variable stores the status as **true** or **false** |

**Example**

**Counts the total number of occurrences of a specific block in the provided XML content**\
\
The **Get Block Count** action takes the value from the Input Value column (e.g., **\<Root>\<User>\<Name>John\</Name>\</User>\<User>\<Name>Jane\</Name>\</User>\</Root>;User**) and counts the number of times the specified block name appears within the given XML block or tags. The count result is stored in the **{Count}** variable, while the execution status is stored in the **{Status}** variable, with the following possible values:

* **True** – if the block count is successfully retrieved.
* **False** – if the count operation fails or an error occurs.

<figure><img src="/files/8tqM9WwwutW0xYTcEC08" 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-block-count-1.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.
