# Liquid in in-apps

Write [Liquid](/product/personalization/liquid-templates/) in the content of an in-app to show each user their own data: their Tag values, the attributes of the event that triggered the in-app, and their User ID. For example, greet the user by name and show the promo code passed in the event.

<Aside type="note">
Liquid in in-apps is off by default. To enable it for your account, contact your Customer Success Manager or support.
</Aside>

## Where Liquid works in in-apps

Liquid works only in an in-app that a journey shows with the [In-App element](/product/customer-journey/journey-elements/channels/in-app/). Both **Show in-app** modes work: **On next app launch** and **On event**.

Write the Liquid in one of these places:

* The text of a built-in editor block, such as an [HTML block](/product/content/in-apps/no-code-in-app-editor/built-in-editor-blocks-reference/#html) or a **Text** block. Text in every language of the in-app works.
* The `index.html` file of an uploaded HTML archive.
* A text field of a [native in-app](/product/content/in-apps/create-native-in-app-messages/).

## Add Liquid to an in-app

To add Liquid, write it in the in-app editor, then select the in-app in a journey.

1. Open the in-app in the built-in editor.
2. Add an **HTML** block, or select an existing one.
3. In the **HTML** field, type the Liquid code by hand.

   <img src="/personalization-liquid-templates-8.webp" alt="HTML block settings in the in-app editor with Liquid code that greets the user by firstName, shows the loyalty_tier Tag in upper case, the promo_code event attribute, and an if condition for the gold tier" width="407"/>

4. Click **Save**.
5. In the **In-App** element of your journey, select the in-app in **Media Source**.
6. If the in-app uses event attributes, choose **On event** in **Show in-app** and select the event.

The editor preview shows the Liquid code as written. Each user sees their own values.

<Aside type="note">
The **Merge tag** button doesn't insert Liquid. It inserts a Dynamic content placeholder such as `{firstName|regular|}`. Placeholders and Liquid work together in one in-app.
</Aside>

In this example, `firstName` and `loyalty_tier` are Tags, and `promo_code` is an attribute of the event that shows the in-app:

<Tabs>
<TabItem label="Input">

```liquid
<h2>
Hi, {{ firstName | default: "there" }}!
</h2>
<p>
Your {{ loyalty_tier | upcase }} code:
<b>{{ promo_code }}</b>
</p>
{% if loyalty_tier == "gold" %}
<p>Shipping is on us today.</p>
{% endif %}
```

</TabItem>

<TabItem label="Output">

Hi, Anna!

Your GOLD code: AUTUMN-42

Shipping is on us today.

</TabItem>

</Tabs>

## Data you can use

These values are available in the Liquid of an in-app:

| Value | What it is | How to write it |
|---|---|---|
| [Tag](/product/audience-data-and-segmentation/user-data-tags/tags/) | A piece of user data stored in Pushwoosh, such as the user's name. The in-app shows the value it has when the in-app is shown. | `{{ loyalty_tier }}` |
| Event attribute | An attribute of the event selected in **On event** mode of the In-App element. If an attribute has the same name as a Tag, the attribute value is used. | `{{ promo_code }}` |
| User ID | The ID your app assigns to the user. | `{{ userid }}`, in lowercase |
| HWID | The hardware ID of the user's device in Pushwoosh. | `{{ hwid }}`, in lowercase |

## Write variable names

Follow these rules when you type a variable name:

* Type the name exactly as it is in Pushwoosh, including capital letters. A name that doesn't match, for example `{{ firstname }}` for the Tag `firstName`, shows as empty text.
* Write Tag and attribute names without spaces: `{{ LoyaltyTier }}` for a Tag named `Loyalty Tier`.
* To show a fallback instead of empty text, add the `default` filter: `{{ firstName | default: "there" }}`.

## Change how a value looks

To change how a value looks, add a [Liquid filter](https://shopify.github.io/liquid/filters/abs/). All standard filters work, for example `upcase`, `capitalize`, `date`, and `truncate`, and so does the Pushwoosh `timezone` filter.

## Limitations of Liquid in in-apps

In an in-app, Liquid has these limits:

* If you send the in-app as an Instant in-apps campaign (**Campaigns** > **Instant in-apps**), Liquid isn't applied and users see the code as written. Use [Dynamic content](/product/personalization/dynamic-content/) placeholders instead.
* `{% include %}` isn't supported. Write the full code in the in-app itself.
* [Connected content](/product/personalization/liquid-templates/connected-content/) isn't supported. Use the values from [Data you can use](#data-you-can-use) instead.
* If the in-app archive is larger than 1 MB, Liquid isn't applied and the user sees the code as written.
* If the Liquid code has an error, for example an unclosed `{% if %}`, the user sees the in-app with the code as written. Check the in-app on your own device before you launch the journey.