# 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>`&#x20;

| 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:**&#x20;

| 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**&#x20;

**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: 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-1.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.
