# How to interpret personalization errors?

### “Illegal char…”

**Meaning**: A character appeared where only a name, number, separator, or part of a string was expected.

**Typical Causes:**

* Using the string delimiter (`'`) or variable prefix (`$`) in the wrong place.
* Mixing double quotes where the language requires single quotes.
* Introducing a non-alphanumeric character while building an identifier or a number.

**Examples:**

👉 `{% if trigger_event.name == “John” %}` instead of `{% if trigger_event.name == 'John' %}`&#x20;

⇒ *The issue is the double quotes* `“”`*.*

👉`price $ 30` instead of `price == 30`&#x20;

⇒ `$` *on its own becomes an illegal char.*

### “Illegal token…”

**Meaning**: A symbol of this type is not allowed in this part of the code.

**Typical Causes**

* Forgetting a comma between arguments.
* Using the wrong operator.

**Examples:**

👉 `price => 3` instead of `price >= 3`&#x20;

⇒ *The correct operator is* `>=`.

👉 `{% set $product = lookup('products' '1') %}` instead of&#x20;

`{% set $product = lookup('products', '1') %}`&#x20;

⇒ *There should be a comma between the catalog name* `‘products’` *and the catalog id* `‘1’`.

### “Unbalanced parenthesis…”

**Meaning**: Closing a parenthesis incorrectly or without valid arguments.

**Example** :

👉`{% set $product = lookup('products', '1' %}` instead of

`{% set $product = lookup('products', '1') %}`&#x20;

⇒ *The second parenthesis after the catalog id* `‘1’` *is missing.*

### “Unbalanced sections…”

**Meaning:** The control block was not properly closed.

**Example:**

👉 `{% if age > 5 %}`` `**`CONTENT`** instead of `{% if age > 5 %}`` `**`CONTENT`**` ``{% endif %}`&#x20;

⇒ *The closing block* `{% endif %}` *is missing.*

### “Unbalanced string…” :

**Meaning**: A string was opened but not properly closed.

**Example**:

👉 `{% if name == 'XYZ %}` instead of `{% if name == 'XYZ' %}`&#x20;

⇒ *The closing quote* `‘` *is missing.*

### **“Illegal attribute/tag/event name …”**

**Meaning:** The name doesn’t match the expected format, scope, or permissions.

**Example:**

👉 `user..age` instead of `u.age` or `age`&#x20;

⇒ *The format of the attribute is incorrect.*

### **“A var name and then the equal operator was expected”**

**Meaning**: After `{% set`, there must be a `$variable` followed by `=`.

**Example:**

👉 `{% set = 3 %}` instead of `{% set $user_id = 3 %}`&#x20;

⇒ *The* `$variable` *is missing.*

### **“A var name and then the 'in' keyword was expected”**

**Meaning**: After `{% for`, there must be a variable followed by `in`.

**Example**:

👉 `{% for $item list %}` instead of `{% for $item in list %}`&#x20;

⇒ *The* `in` *is missing.*

### **“The body can't be empty”**

**Meaning**: The block associated with an `if`, `else if`, `else` or `for` is empty.

**Example:**

👉`{% if condition %}{% endif %}` instead of `{% if condition %}`**`CONTENT`**`{% endif %}`&#x20;

⇒ *There is no content between the display conditions (for dynamic content in SMS, push and In-App).*

### **“Illegal sign operator”**

**Meaning:**

`+` or `-` is used in front of a value that is not a number.

**Example:**

👉 `{% if -true > user_score %}` instead of `{% if -4 > user_score %}`

⇒ `true` *is not a number, and therefore* `-true` *is not valid.*

### **“Invalid filter”**

**Meaning**: The filter used to transform the argument is incorrect.

**Example:**

👉`{% if first_name|title(nullIfEmpty:true) != None %}` instead of&#x20;

`{% if first_name|trim(nullIfEmpty:true) != None %}`&#x20;

⇒ *The filter* `title(nullIfEmpty:true)` *is incorrect.*

### “Illegal end of string…”

**Meaning:** The string ends too early due to a closing parenthesis missing or placed incorrectly.

**Example:**

👉 `hello {{first_name` instead of `hello {{first_name}}`&#x20;

⇒ *The closing parenthesis is missing.*

### “Illegal decimal separator…”

**Meaning:** The symbol used to separate the whole part from the fractional part of a number is incorrect.

**Example:**

👉 `{% if age > 1..5 %}` instead of `{% if age > 1.5 %}`&#x20;

⇒ *The decimal is incorrect.*

### “Illegal unit char…”

**Meaning:** A character that isn’t allowed appeared inside a unit (the part that describes measurement like `kg`, `ms`, `cm`).

**Example:**

👉`{% if distance > 10km@ %}` instead of `{% if distance > 10km %}`&#x20;

⇒ *The unit is incorrect.*

### “Unable to parse this constant…”

**Meaning:** The system couldn’t read the constant because it’s malformed or contains invalid characters.

**Example:**

👉 `{% if subscription_date == 90days %}` instead of `{% if subscription_date == 90d %}`&#x20;

⇒ *The constant* `days` *is incorrect.*

### “Partial tag… is not allowed”

**Meaning**: A partial tag is a tag whose full set of values cannot be listed. If a tag is partial (like `b.custom_audiences`), you cannot use it where the system must enumerate or join all values.

**Example:**

👉 `{{ b.custom_audiences | join(", ") }}`&#x20;

⇒ *The system cannot return the complete list of audiences for an installation.*


---

# 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://doc.batch.com/guides-and-best-practices/orchestration/how-to-interpret-personalization-errors.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.
