# Scope

A condition is checked against a specific payload to determine whether it's a match or not. The payload can contain several instances of the resources specified in the condition's field. By default a condition is considered satisfied if at least one (i.e. **any**) of those instances matches the condition's requirements. If you want to override this behavior and ensure that a condition is satisfied only if **all** of those instances match the condition's requirements, you need to modify the condition scope.

## Example

Let's consider the [previous example](https://docs.commercelayer.io/rules-engine/conditions/..#example) and add the `scope` key with value `all` to the second condition to better understand how the matching criteria change:

{% tabs %}
{% tab title="Any (default)" %}
The following couple of conditions check if an order is tagged as `dropship` *and* contains at least a line item whose SKU code starts with the string `TSHIRT`:

```json
"conditions": [
  {
    "field": "order.tags.name",
    "matcher": "eq",
    "value": "dropship"
  },
  {
    "field": "order.line_items.sku.code",
    "matcher": "start_with",
    "value": "TSHIRT",
    "group": "tshirts"
  }
]
```

{% endtab %}

{% tab title="All" %}
The same couple of conditions now check if an order is tagged as `dropship` and the SKU code of *all* its line items associated with an SKU starts with the string `TSHIRT`:

<pre class="language-json"><code class="lang-json">"conditions": [
  {
    "field": "order.tags.name",
    "matcher": "eq",
    "value": "dropship"
  },
  {
    "field": "order.line_items.sku.code",
    "matcher": "start_with",
    "value": "TSHIRT",
<strong>    "scope": "all",
</strong>    "group": "tshirts"
  }
]
</code></pre>

{% endtab %}
{% endtabs %}
