# 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: 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/string-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.
