> For the complete documentation index, see [llms.txt](https://docs.r4nkt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r4nkt.com/concepts/criteria-groups.md).

# Criteria Groups

## Description

A criteria group is a group of criteria and/or nested criteria groups. A criteria group is attached to an [achievement](/concepts/achievements.md) and used to determine whether or not the achievement has been earned by a player.

## Properties

A criteria group has the following properties:

| Name             |    Type    | Default |
| ---------------- | :--------: | :-----: |
| custom\_id       |   string   |    -    |
| name             |   string   |    -    |
| description      |   string   | *empty* |
| operator         |   string   |   and   |
| criteria         | collection | *empty* |
| criteria\_groups | collection | *empty* |
| conditions       |    json    | *empty* |

{% hint style="info" %}
Click [here](/concepts/overview.md#common-properties) for information about common properties.
{% endhint %}

### Operator

The criteria group's `operator` property determines which boolean logic is employed when it is evaluated. It can have any one of the following values:

* `and`: The criteria group's criteria and nested criteria groups will be `and`ed together when evaluated. This means that all criteria and nested criteria groups for a criteria group with `operator` equal to `and` must be `true` for it to evaluate to `true` itself.
* `or`: The criteria group's criteria and nested criteria groups will be `or`ed together when evaluated. This means at least one of a criteria group's criteria or nested criteria groups must be `true` for it to evaluate to `true` itself.
* `xor`: The criteria group's criteria and nested criteria groups will be `xor`ed together when evaluated. This means only one of a criteria group's criteria or nested criteria groups can be `true` for it to evaluate to `true` itself.

{% hint style="warning" %}
If a criteria group has neither criteria nor nested criteria groups, then it will **always** evaluate to `false`, regardless of its operator value.
{% endhint %}

### Criteria

A criteria group can have multiple [criteria](/concepts/criteria.md). They can be attached to a criteria group in order to be evaluated against a player's activities.

### Criteria Groups

A criteria group may itself have nested criteria groups. This allows for a single achievement to have simple or complex criteria.

Some notes about nested criteria groups:

* Criteria groups can have zero or more nested criteria groups.
* Criteria groups cannot have duplicate nested criteria groups.
* Chains can be defined. That is, criteria group A can nest criteria group B, which can nest criteria group C.
* Chains may not be cyclical. That is, criteria group A can nest criteria group B, but criteria group B cannot nest criteria group A.
* Depending on your subscription, there may be limits to the number of nested criteria groups a single criteria group can have as well as the depth or length of an criteria group-nested-criteria group chain.

### Conditions

[Criteria conditions](/concepts/criteria-conditions.md) are common to both [criteria](/concepts/criteria.md) and criteria groups. If present, they are applied before looking to see if a criterion has been met. Conditions provide a way to filter player activities when determining whether or not a criterion has been met. Once filtered, the [criterion's rule](/concepts/criteria.md#rule) is used against whatever activities remain.
