> 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="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FVrdjFTjaKBqOOmf2bEBt%2Fimage.png?alt=media&amp;token=a782a008-3084-4246-b16c-8d722430b54a" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
