20. Keep strings, numbers and flags straight
| Input in a JSON-value field | Meaning |
|---|---|
| 7 | A number. |
| "7" | Text containing a digit. |
| true / false | Booleans, with no quotes. |
| "true" | Text, not a Boolean flag. |
| "brass_key_item" | A literal item ID as text. |
| [1,2,3] | An array. |
| {"x":1,"y":2} | A dictionary/object. |
| null | No value. |
| {"$var":"score"} | An expression that reads a live value. |
A plain string field, such as a message or parameter of type string, normally accepts ordinary unquoted text. A field labeled JSON or variant needs valid JSON to preserve structured values. Follow the field’s type rather than applying one quoting rule to every box.
1. If a comparison fails unexpectedly, inspect the value type before adding more branches.
2. Check whether a number was quoted, a flag was typed as text or an expression was entered in a plain string field.
3. Check capitalization and spelling in IDs and expression keys.
4. Use a small Return or result variable to inspect the actual value.
Invalid JSON may remain literal text in generic variant fields or fail validation in stricter function fields. Do not assume a field accepted the intended value just because the characters are still visible.
