DOS AI/ Documentation
ReviewsFeaturesPricingFor whomFor agenciesLearningSign inStart
Documentation
Contents
OverviewHighlightingVariablesDate & timeDate formatTimezonesStringsConditions & logicUtilsExamplesWhere it works
DOCS/EXPRESSIONS

Expression language

Insert dynamic data into prompts, greetings and follow-up messages. Syntax: {{выражение}}

Overview

Expressions let you use variables and functions inside text fields. Anything inside double curly braces {{ }} will be evaluated and replaced with a value at the moment the message is sent.
Привет, {{client_name}}! Сейчас {{now "Asia/Almaty" "HH:mm"}}→Hi, Almas! It's 14:30
If a variable is not found or the expression is invalid, the text stays as-is, the prompt doesn't break.

Editor highlighting

When you type expressions in the prompt editor, a panel with detected expressions appears at the bottom:
3 expressions2 OK1 error
✓ {{client_name}}✓ {{now "Asia/Almaty"}}✗ {{broken}
Each detected expression is shown as a chip: green with ✓ if valid, red with ✗ if a syntax error. A link to this reference is also available.

Variables

Available in the context of the current dialog. If data is missing, an empty string is returned.
{{client_name}}
Client name
Example: Алмас
{{client_phone}}
Client phone
Example: +77001234567
{{phone}}
Алиас для {{client_phone}}
Example: +77001234567
{{name}}
Алиас для {{client_name}}
Example: Алмас
{{channel_phone}}
Номер, с которого пишет клиент, только от канала: анкета и ИИ его не меняют. Для проверок по номеру
Example: +77001234567
{{project_name}}
Project name
Example: Салон Glamour
{{channel}}
Channel
Example: WhatsApp
{{username}}
Ник клиента в Instagram или Telegram (@ник), если известен
Example: @aliya.style
{{contact}}
Как связаться: телефон, а без него @ник
Example: +77001234567
{{dialog_link}}
Ссылка на этот диалог в кабинете DOS AI
Example: https://dosai.pro/projects/…/chats/…
{{stage}}
Funnel stage
Example: qualification
{{lead_status}}
Lead status
Example: hot
{{summary}}
Краткое содержание разговора
Example: Клиент интересовался ценами
{{data}}
Collected client data (object)
Example: {{data.email}}
{{responsible}}
Ответственный менеджер за эту заявку
Example: Манат

Date & time

Dates and times use the project timezone from the bot settings, or Asia/Almaty when it is not set. Pass another timezone as the first argument and the format as the second.
now
Current date and time
{{now}} {{now "Asia/Almaty"}} {{now "UTC" "DD.MM.YYYY HH:mm"}}
date
Date only
{{date}} {{date "Asia/Almaty"}} {{date "UTC" "YYYY-MM-DD"}}
time
Time only
{{time}} {{time "Asia/Almaty"}} {{time "UTC" "HH:mm:ss"}}
day_of_week
Day of week
{{day_of_week}} {{day_of_week "Asia/Almaty"}}
timestamp
ISO 8601 timestamp
{{timestamp}}
format_date
Format a date
{{format_date some_date "DD MMMM YYYY" "Asia/Almaty"}}
{{now}}→07.04.2026 09:30
{{now "Asia/Almaty"}}→07.04.2026 15:30
{{now "Asia/Almaty" "DD MMMM YYYY, dddd"}}→April 7, 2026, Monday
{{time "Europe/Moscow"}}→12:30
{{day_of_week "Asia/Almaty"}}→Monday

Date format tokens

YYYY
Full year
2026
YY
Short year
26
MMMM
Month (word)
апреля
MMM
Month (abbr.)
апр
MM
Month (number)
04
DD
Day
07
dddd
Day of week
понедельник
ddd
Day of week (abbr.)
пн
HH
Hours (24h)
14
mm
Minutes
30
ss
Seconds
05

Timezones

You can use any IANA timezone. Popular ones:
UTCAsia/AlmatyEurope/MoscowEurope/LondonAmerica/New_YorkAsia/DubaiAsia/IstanbulEurope/BerlinAsia/Tokyo

String helpers

upper
UPPERCASE
{{upper client_name}}
lower
lowercase
{{lower channel}}
capitalize
First letter capitalized
{{capitalize client_name}}
trim
Trim whitespace
{{trim value}}
truncate
Truncate to N chars
{{truncate client_name 20}}
concat
Concatenate strings
{{concat "Привет, " client_name "!"}}
default
Default value
{{default client_name "Клиент"}}
{{upper client_name}}→ALMAS
{{default client_name "Клиент"}}→Client (if name is unknown)
{{concat "Здравствуйте, " client_name "!"}}→Hello, Almas!

Conditions & logic

#if / else
Condition
{{#if client_name}}Привет, {{client_name}}!{{else}}Привет!{{/if}}
#unless
If NOT
{{#unless client_phone}}Оставьте номер{{/unless}}
eq
Equals
{{#if (eq stage "closing")}}Сделка закрывается{{/if}}
ne
Not equal
{{#if (ne channel "WhatsApp")}}...{{/if}}
gt / lt
Greater / less than
{{#if (gt data.amount 10000)}}VIP{{/if}}
and / or / not
Logical operators
{{#if (and client_name client_phone)}}Данные есть{{/if}}
Condition examples:
{{#if client_name}}
Привет, {{client_name}}! Чем могу помочь?
{{else}}
Здравствуйте! Как к вам обращаться?
{{/if}}

{{#if (eq channel "WhatsApp")}}
Вы пишете через WhatsApp.
{{/if}}

{{#if (and client_name client_phone)}}
Отлично, все данные получены!
{{/if}}

{{#unless client_phone}}
Пожалуйста, оставьте номер телефона.
{{/unless}}

Utils

json
JSON representation
{{json data}}
length
String/array length
{{length client_name}}
math
Arithmetic
{{math 100 "+" 50}} {{math price "*" 1.12}}
digits
Только цифры (для ссылок wa.me / tel)
https://wa.me/{{digits phone}}
{{math 100 "+" 50}}→150
{{math price "*" 1.12}}→11200
{{json data}}→{"email": "test@mail.kz", "phone": "+7..."}

Real examples

Prompt for a beauty salon:
Ты AI-ассистент {{project_name}}.
Сегодня {{now "Asia/Almaty" "dddd, DD MMMM"}}.

{{#if client_name}}
Клиента зовут {{client_name}}: обращайся по имени.
{{/if}}

{{#if (eq stage "closing")}}
Клиент готов к записи это предложи ближайшее свободное время.
{{/if}}
Welcome message:
Здравствуйте{{#if client_name}}, {{client_name}}{{/if}}!
Я ассистент компании {{project_name}}.
Сейчас {{time "Asia/Almaty"}} (Астана). Чем могу помочь?
Follow-up message:
{{#if client_name}}{{client_name}}, вы{{else}}Вы{{/if}} ещё
с нами? Сегодня {{now "Asia/Almaty" "dddd"}}
{{#if (eq (day_of_week "Asia/Almaty") "пятница")}}
последний рабочий день, успейте записаться!
{{else}}
будем рады помочь!
{{/if}}

Where expressions work

System prompt
Full context: client, project, dialog
Works
Welcome message
Client name, project, channel
Works
Follow-up messages
Client name, project
Works
Notification templates
Event data: client, project, channel
Works
Test chat
Project only (no client data)
Works