1 + (2 - 3) * 4 / 5 ^ 6->
contact.first_name & " " & contact.last_name->
dd-mm-yy(environment will help with ambiguous cases)
contact.age > 18->
@character to denote either a single variable substitution or the beginning of an Excellent block.
@was chosen as it is known how to type by a broad number of users regardless of keyboard. It does have the disadvantage of being used in email addresses and Twitter handles, but these are rarely ambiguous and escaping can be done easily via doubling of the character (
10 plus 4 is @(SUM(10, 4))Within a block,
@is not required to refer to variable in the context:
Hello @(contact.name)A template can contain more than one substitution or block:
Hello @contact.name, you were born in @(YEAR(contact.birthday))
__value__element, that is used in substitution
__value__element, JSON representation is substituted
This is a date @DATE(2012, 12, 25)
You joined on @DATEVALUE(contact.joined_date)
The current day is @DAY(contact.joined_date)
Next month's meeting will be on @EDATE(date.today, 1)
The current hour is @HOUR(NOW())
The current minute is @MINUTE(NOW())
The current month is @MONTH(NOW())
It is currently @NOW()
The current second is @SECOND(NOW())
2 hours and 30 minutes from now is @(date.now + TIME(2, 30, 0))
Your appointment is at @(date.today + TIME("2:30"))
Today's date is @TODAY()
Today is day no. @WEEKDAY(TODAY()) in the week
The current year is =YEAR(NOW())
@AND(contact.gender = "F", contact.age >= 18)
Dear @IF(contact.gender = "M", "Sir", "Madam")
@OR(contact.state = "GA", contact.state = "WA", contact.state = "IN")
The absolute value of -1 is @ABS(-1)
Please complete at most @MAX(flow.questions, 10) questions
Please complete at least @MIN(flow.questions, 10) questions
2 to the power of 3 is @POWER(2, 3)
You have =SUM(contact.reports, contact.forms) reports and forms
As easy as @CHAR(65), @CHAR(66) , @CHAR(67)
You entered @CLEAN(step.value)
The numeric code of A is @CODE("A")
Your name is @CONCATENATE(contact.first_name, " ", contact.last_name)
You have @FIXED(contact.balance, 2) in your account
You entered PIN @LEFT(step.value, 4)
You entered @LEN(step.value) characters
Your name is @PROPER(contact)
Stars! @REPT("*", 10)
Your input ended with ...=RIGHT(step.value, 3)
@SUBSTITUTE(step.value, "can't", "can")
As easy as =UNICHAR(65), =UNICHAR(66) , =UNICHAR(67)
The numeric code of A is @UNICODE("A")
The first word you entered was @FIRST_WORD(step.value)
You've completed @PERCENT(contact.reports_done / 10) reports
Your number is @READ_DIGITS(contact.tel_e164)
You entered @REMOVE_FIRST_WORD(step.value)
@WORD("hello cow-boy", 2)will return "cow"
@WORD("hello cow-boy", 2, TRUE)will return "cow-boy"
@WORD("hello cow-boy", -1)will return "boy"
You entered @WORD_COUNT(step.value) words
@WORD_SLICE("RapidPro expressions are fun", 2, 4)will return 2nd and 3rd words "expressions are"
@WORD_SLICE("RapidPro expressions are fun", 2)will return "expressions are fun"
@WORD_SLICE("RapidPro expressions are fun", 1, -2)will return "RapidPro expressions"
@WORD_SLICE("RapidPro expressions are fun", -1)will return "fun"
@ISNUMBER(contact.age)will return TRUE if the contact's age is a number.
@ISBOOL(block.value)will return TRUE if the block returned a boolean value.
@ISSTRING(contact.name)will return TRUE if the contact's name is a string.