> 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/string-variable-rules.md).

# String Variable Rules

## String: When Rules

1. **changes**: Gets triggered if the string variable undergoes a change.
2. **is =**: If the value or input of a string variable matches a certain number, a specific action can be triggered.
3. **is in the list / is not in the list** - If the value or input of a string variable is present or not present in a predefined comma-separated list, a certain action can be triggered.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FLxw3LWP5C1ORfmfibkc0%2Fimage.png?alt=media&#x26;token=8f43c358-ed57-495c-b6ff-ce49d3e6d0e4" alt=""><figcaption><p>String: When Rules</p></figcaption></figure>

## String: Then Rules

1. **reset to default value** - This will set the variable back to its default value.
2. **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).
3. **append capture data** - Appends the captured value (as opposed to completely replacing the current string with the captured value).
4. **set to string** - Sets it to a string value.
5. **find and replace -**  provided the ability to locate specific text, letters within a string variable and replace them with a desired value, and store the resulting value in this string variable.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FqBMA5OPO61EdyMOuUJ94%2Fimage.png?alt=media&#x26;token=7363a697-8521-41aa-96b9-9a08dbb7d2b8" alt=""><figcaption><p>String: 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gmetri.com/metaverse/build/rules/string-variable-rules.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
