# Advanced Filtering

{% hint style="info" %}
This feature is available in the following plans:\
~~<mark style="background-color:red;">Free</mark>~~ | <mark style="background-color:$success;">Standard</mark> | <mark style="background-color:$success;">Professional</mark> | <mark style="background-color:$success;">Enterprise</mark>\
[View pricing and plan details →](https://www.docexport.com/pricing/)
{% endhint %}

## Concept of advanced filtering

Some filters can't be automatically retrieved from your monday board (e.g. subitems). In such cases, we need to load all items and filter on our side by including the filter condition in the docx template.

**Note:** That's a relatively rare needed feature for advanced use cases. Please check out these help center articles before:

* [Apply board filters](/template/board-level-filter.md)
* [Dynamic Tables](/features/dynamic-tables.md)

{% embed url="<https://youtu.be/TdBTKctKgMg?si=cpCaW2GaLX-7Jobb&t=1533>" %}

### **Step 1: Retrieve the filter string**

1. Open the DocExport view in your monday board
2. Click on "More"
3. Select 'Subscription' and apply your preferred filters in the board
4. Click on the button 'Copy filter condition' to retrieve the specific, coded filter string:

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

The copied filter string could look like this:

{% code overflow="wrap" %}

```
W3tjb2x1bW5faWQ6Im5hbWUiLGNvbXBhcmVfdmFsdWU6WyJNaWxlc3RvbmUiXSxjb21wYXJlX2F0dHJpYnV0ZToiIixvcGVyYXRvcjpjb250YWluc190ZXh0fSx7Y29sdW1uX2lkOiJzdGF0dXMiLGNvbXBhcmVfdmFsdWU6WzBdLGNvbXBhcmVfYXR0cmlidXRlOiIiLG9wZXJhdG9yOmFueV9vZn1d
```

{% endcode %}

**Background information for advanced users:**\
This code is a Base64 encoded filter string from monday. If you decode this string, the result would be

{% code overflow="wrap" %}

```
[{column_id:"name",compare_value:["Milestone"],compare_attribute:"",operator:contains_text},{column_id:"status",compare_value:[0],compare_attribute:"",operator:any_of}]
```

{% endcode %}

### **Step 2: Include filter in a template**

You can now use this filter in your templates.

#### Advanced Filter for Item Level

If you want to use the filter for item level, the filter needs to be included in the  **`{{TableStart:Groups}}`** and **`{{TableEnd:Groups}}`** placeholders within brackets:

`{{TableStart:Groups`**`(Filter string)`**`}}`

`{{TableEnd:Groups`**`(Filter string)`**`}}`

In your template, it would look something like this (highlighted in red):

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

#### Advanced Filter for SubItem Level

{% embed url="<https://youtu.be/TdBTKctKgMg?si=Cjd5oN_wylhThuM6&t=1774>" %}

You can also add the filter to a subitem table (see: [Subitem Table](/template/subitem-table.md)).

In this case, the filter needs to be included in the **`{{TableStart:SubItems}}`** and **`{{TableEnd:SubItems}}`** placeholders within brackets:

`{{TableStart:SubItems`**`(Filter string)`**`}}`

`{{TableEnd:SubItems`**`(Filter string)`**`}}`

In your template, it would look something like this (highlighted in yellow):

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

#### Combination of both SubItem and Item Level Filter

In this case, both the item level and the SubItem filter needs to be included in the document.&#x20;

In your template, it would look something like this (Item level filter highlighted in red, SubItem filter highlighted in yellow):

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

**Note:** this feature is an advanced feature and you just need it in specific use cases. If you have any questions, please reach out to our [support team](https://www.docexport.com/contact).

{% hint style="warning" %}
**Note:** Filtering and sorting by ***Mirror*****&#x20;or&#x20;*****Formula*** columns is currently not available.\
This is due to limitations in the monday.com API, which does not provide the required data for these column types.
{% endhint %}


---

# 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://help.docexport.com/template/advanced-filtering.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.
