LiquidJS Template Variables
RCS Studio uses LiquidJS to make your messages dynamic. Any string input field in the builder supports Liquid syntax — that includes message text, card titles, descriptions, button labels, URLs, and more. Anywhere you can type, you can use template variables.
There are several types of variables available depending on how your agent is configured:
| Variable | What it gives you | Example |
|---|---|---|
params | Parameters you pass in via the API or postback data | {{ params.firstName }} |
data | Results from connector operations | {{ data.orderLookup.status }} |
input | The user's most recent message or action | {{ input.text }} |
user | Information about the end user | {{ user.msisdn }} |
params
These are parameters you provide — either through an API request body or from a user's button tap postback data. They're the most common way to inject dynamic content into your templates.
Hello {{ params.firstName }}!
Your order #{{ params.orderId }} is {{ params.status }}.You can also pass nested objects and access them with dot notation:
{{ params.address.city }}, {{ params.address.state }}data
When your agent uses connectors to fetch external data (like looking up an order or calling a weather API), the results are stored in data under the context key you configure in the operation.
{% if data.orderLookup.status == "shipped" %}
Your order shipped on {{ data.orderLookup.shipDate | date_format: "MMMM D, YYYY" }}.
{% else %}
Your order is being prepared.
{% endif %}input
This gives you access to whatever the user just sent — whether they typed a message, tapped a button, shared their location, or sent a file.
| Field | What it contains |
|---|---|
input.text | What the user typed, or the label of the button they tapped |
input.location | Location coordinates if the user shared their location |
input.file | File metadata if the user sent a file |
You said: {{ input.text }}user
Information about the end user interacting with your agent.
| Field | What it contains |
|---|---|
user.msisdn | The user's phone number in E.164 format (e.g. +15551234567) |
Examples
Personalized greeting
Hi {{ params.firstName }}, welcome to {{ params.brandName }}!Conditional content based on connector data
{% if data.weather.temp > 80 %}
It's {{ data.weather.temp }}°F — stay cool!
{% else %}
It's {{ data.weather.temp }}°F — have a great day!
{% endif %}Echoing user input
You said: {{ input.text }}. Let me look that up for you.Updated about 1 month ago