# Boolean Variable Rules

Booleans can have only one of two possible values: `true` or `false`.&#x20;

They are commonly used in conditional statements to make decisions based on whether a certain condition is true or false. You can choose the Default Value as either `true` or `false`.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2F3AMPge7qpyS6iFvoxrRN%2Fimage.png?alt=media&#x26;token=c10588b1-a9de-411c-90c9-d0ad0c36d5a9" alt=""><figcaption><p>Boolean Variables</p></figcaption></figure>

## Boolean: When Rules

1. **changes**: Gets triggered if the boolean variable undergoes a change.
2. **is TRUE:**  Gets triggered if the boolean variable changes to `true`.
3. **is FALSE:**  Gets triggered if the boolean variable changes to `false`.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2F9Ww79nRpm0VDFAAp3Frv%2Fimage.png?alt=media&#x26;token=7251f6b2-f6d4-4db9-9c04-c6a96dafd42f" alt=""><figcaption><p>Boolean: When Rules</p></figcaption></figure>

## Boolean: Then Rules

1. **reset to default value** - This will set the variable back to its default value.
2. **set to true** - Sets the boolean to `true`.
3. **set to false** - Sets the boolean to `false`.
4. **capture data** - This action copies the value from the "When" side of the rule. Check [String Substitution](/metaverse/build/variables/string-substitution.md#capturing-user-input).

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FhRiZ0wRPCXEwL3OMftYH%2Fimage.png?alt=media&#x26;token=cb13830f-37ef-41ef-bf39-bd4947e20ac3" alt=""><figcaption><p>Boolean: Then Rules</p></figcaption></figure>


---

# 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.gmetri.com/metaverse/build/rules/boolean-variable-rules.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.
