> For the complete documentation index, see [llms.txt](https://docs.bluefletch.com/bluefletch-enterprise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/launcher3/configurable-layouts/criteria.md).

# Criteria

Launcher can match certain values against regular expressions to customize intents and groups

## Overview

Filtering of custom intents and definition of implied groups can be accomplished with and/or criteria and regular expressions (regex). A criterion checks the value stored in a replacement variable from the device, Launcher, the configuration file, or session object against a regex pattern to determine what device behavior or layout should apply in a specific scenario.

## Technical Guide

### **Criteria Arrays**

| Field         | Description                                                                                     |
| ------------- | ----------------------------------------------------------------------------------------------- |
| criteria\_OR  | **array** Filters for instances where at least one field matches its pattern.                   |
| criteria\_AND | **array** Filters for instances where **all** fields must must match their respective patterns. |

{% hint style="warning" %}
Both `"criteria_OR"` and `"criteria_AND"` arrays need to be included in an object, even if one is empty.
{% endhint %}

### **Criteria Object Parameters**

| Field   | Description                                                                                                              |
| ------- | ------------------------------------------------------------------------------------------------------------------------ |
| field   | **string** A replacement variable, written in the format `"_${`*`replacement variable`*`}"` (e.g. `"_${device.MODEL}"`). |
| pattern | **string** The regular expression that is desired to match the field's content.                                          |

## Examples

### Criteria for Custom Intent Filtering

<pre class="language-json"><code class="lang-json">"intents": {
    "boot": [
        // Run a StageNow XML on boot for all device models starting with "TC":
        {
            "typeIntent": "p",
            "action": "XML",
            "data": "file/path/to/stageNowFile.xml",
            "criteria_OR": [
                {
                    "field": "_${device.MODEL}",
                    "pattern": "/^TC.*$/"
                }
            ],
            "criteria_AND": []
        }
    ],
    "cradle": [
        // Rotate the Launcher to landscape on cradle for device models starting with "ET" or "CC":
        {
            "action": "com.bluefletch.launcher.ACTION_ROTATE_LANDSCAPE",
            "typeIntent": "p",
            "criteria_OR": [
                {
                    "field": "_${device.MODEL}",
                    "pattern": "/^ET.*$/"
                },
                {
                    "field": "_${device.MODEL}",
                    "pattern": "/^CC.*$/"
                }
            ],
            "criteria_AND": []
        },
        // Mute audio on cradle if device is logged out (no user ID) and is at site 1001:
        {
            "action": "MUTE_AUDIO",
            "typeIntent": "p",
            "criteria_AND": [
<strong>                {
</strong>                    "field": "_${session.userId}",
                    "pattern": "^_$"
                },
                {
                    "field": "_${config.ex.siteId}",
                    "pattern": "1001"
                }
            ],
            "criteria_OR": []            
        }
    ]                 
}
</code></pre>

### Criteria for Implied Groups

```json
"impliedGroups" : [
    // Display this group's layout if the session object's group name contains "Blue" or "BLUE": 
    {
        "group": "ContainsBLUE_or_Blue_Group",
        "criteria_OR": [
            { "field": "${session.groups}", "pattern": ".*Blue.*|.*BLUE.*" }
        ],
        "criteria_AND": [] 
    },  
    // Display this group's layout if the session object's passwordExpiration attribute contains one or more digits:
    {
        "group": "ContainsNumber_Group",
        "criteria_OR": [
            { "field": "${session.ex.passwordExpiration}", "pattern": "[0-9]+" }
        ],
        "criteria_AND": []
    },
    // Display this group's layout if the session object's group name ends with "Managers"
    // OR the site ID is 1133:
    {
        "group": "EndsWithManager_Or_isSite113_Group",
        "criteria_OR": [
            { "field": "${session.groups}", "pattern": ".*Managers$" },
            { "field": "${config.ex.siteId}", "pattern": "1133" }
        ],
        "criteria_AND": []
    },
    // Display this group's layout if the session object's group name contains "VTV"
    // AND the site name is "Pilot"
    // OR if group name contains "Managers":
    {
        "group": "Pilot_VTV_And_Managers",
        "criteria_AND": [
            { "field": "${session.groups}", "pattern": ".*VTV.*" },
            { "field": "${config.ex.siteName}", "pattern": "Pilot" }
        ],
        "criteria_OR": [
            { "field": "${session.groups}", "pattern": ".*Managers.*" }
        ]
    }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/launcher3/configurable-layouts/criteria.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
