> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/output-module/the-output-module-query-language/boolean-operators.md).

# Boolean operators

You can combine the filtering operators using Boolean operators. Combining Boolean operators results in a logical binary tree of possibilities. Because the binary tree is not easy to read, the `ViewConfig` provides a way of specifying a `Named Logical Array`.

{% tabs %}
{% tab title="JSON" %}

```json
"Filter": {
          "AND": [
            { "Field": { "name": "domainId", "operator": "EQUALS", "value": "02204077-1cd1-4c70-a7c4-4cd845194b81" } },
            { "Field": { "name": "assetId", "operator": "EXISTS", "value": "00000000-0000-0000-0000-000000007001", "target": "RelationSource" } },
            { "Field": { "name": "statusName", "operator": "IN", "values": [ "New", "In Review" ] } }
          ]
        }
```

{% endtab %}

{% tab title="YAML" %}

```yaml
Filter:
  AND:
  -
    Field:
      name: "domainId"
      operator: "EQUALS"
      value: "02204077-1cd1-4c70-a7c4-4cd845194b81"
  -
    Field:
      name: "assetId"
      operator: "EXISTS"
      value: "00000000-0000-0000-0000-000000007001"
      target: "RelationSource"
  -
    Field:
      name: "statusName"
      operator: "IN"
      values:
      - "New"
      - "In Review"
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Filtering elements bundled together in a named array, are logically combined using the name of the array: either `AND` or `OR`. You can also nest these logical arrays, allowing all possible Boolean combinations.
{% endhint %}

{% tabs %}
{% tab title="JSON" %}

```json
"Filter": {
  "AND": [
    {
      "OR": [
        { "Field": { "name": "domainId", "operator": "EQUALS", "value": "02204077-1cd1-4c70-a7c4-4cd845194b81" } },
        { "Field": { "name": "assetId", "operator": "EXISTS", "value": "00000000-0000-0000-0000-000000007001", "target": "RelationSource" } }
      ]
    },
    { "Field": { "name": "statusName", "operator": "IN", "values": [ "New", "In Review" ] } }
  ]
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
Filter:
  AND:
  -
    OR:
    -
      Field:
        name: "domainId"
        operator: "EQUALS"
        value: "02204077-1cd1-4c70-a7c4-4cd845194b81"
    -
      Field:
        name: "assetId"
        operator: "EXISTS"
        value: "00000000-0000-0000-0000-000000007001"
        target: "RelationSource"
  -
    Field:
      name: "statusName"
      operator: "IN"
      values:
      - "New"
      - "In Review"
```

{% endtab %}
{% endtabs %}
