> For the complete documentation index, see [llms.txt](https://docs.gmetri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmetri.com/metaverse/build/rules/boolean-variable-rules.md).

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