Template variables
RCS Studio uses LiquidJS to make your messages dynamic. Any string input field in the builder supports Liquid syntax, including message text, card titles, descriptions, button labels, URLs, and more.
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 }} |
message | The user's most recent message or action | {{ message.text }} |
input | Values captured from input assignments | {{ input.name }} |
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 %}message
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 |
|---|---|
message.text | What the user typed, or the label of the button they tapped |
message.location.latitude | Latitude if the user shared their location |
message.location.longitude | Longitude if the user shared their location |
message.file | File metadata if the user sent a file |
You said: {{ message.text }}input
When you configure input assignments, the captured values are available under input using the field name you specified in the To field.
For example, if you assign the user's text to name, it's available as:
Hello {{ input.name }}!See Assigning Inputs for how to set up input assignments.
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 the user's message
You said: {{ message.text }}. Let me look that up for you.Using a captured input
Got it! We'll send updates to {{ input.email }}.Updated 28 days ago