# Expressions

### **Introduction to Open Loyalty Language**

\
When setting up conditions and effects for rules in [Campaigns](https://help.openloyalty.io/campaigns), you may find that some situations are not covered by premade values. However, you are not limited to using these values - you can use an Open Loyalty language to create very specific conditions and values. \
\
In conditions, you can find a condition called **Expressions**. <br>

<figure><img src="/files/ujK1ryOt4udWqbKwPn7z" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/q9ku9PcYkIIZIWkIUPfL" alt=""><figcaption></figcaption></figure>

You can set the value of such an expression. It can be set as a combination of attributes and operators using the meta language created by Open Loyalty. It allows you to create a fully customizable condition that meets the rules of your planned loyalty program.&#x20;

For example, you can create a campaign that is triggered when a customer buys a product from a certain category. You can do it in two ways:

Set a premade condition:

<figure><img src="/files/QdiWqfToTCod9y3YHklb" alt=""><figcaption></figcaption></figure>

Or use an expression:

<figure><img src="/files/jhZuJO0S2AWltZL8prVk" alt=""><figcaption></figcaption></figure>

In the same way, you can create custom campaign effects - you can use premade values, or enter them yourself:

<figure><img src="/files/V8LljoMOqircjw7rOlGN" alt=""><figcaption></figcaption></figure>

In this section, you will find a description of the meta-language together with all the supported syntaxes, which is based on the expression syntax of Symfony Expression.

***

#### **The component supports**

* strings - single and double quotes (e.g. 'hello')&#x20;
* numbers - integers (e.g. 103), decimals (e.g. 9.95), decimals without leading zeros (e.g. .99, equivalent to 0.99); all numbers support optional underscores as separators to improve readability (e.g. 1\_000\_000, 3.14159\_26535)
* arrays - using JSON-like notation (e.g. \[1, 2])
* hashes - using JSON-like notation (e.g. { foo: 'bar' })
* booleans - true and false
* null - null
* exponential - also known as scientific (e.g. 1.99E+3 or 1e-2)


---

# 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://help.openloyalty.io/main-features/expressions.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.
