# Criteria Groups

## Description

A criteria group is a group of criteria and/or nested criteria groups. A criteria group is attached to an [achievement](https://docs.r4nkt.com/concepts/achievements) 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](https://docs.r4nkt.com/overview#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](https://docs.r4nkt.com/concepts/criteria). 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](https://docs.r4nkt.com/concepts/criteria-conditions) are common to both [criteria](https://docs.r4nkt.com/concepts/criteria) 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](https://docs.r4nkt.com/criteria#rule) is used against whatever activities remain.


---

# 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.r4nkt.com/concepts/criteria-groups.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.
