LetsChat provides you with various built-in operations for variable modification.

There are 6 types of variable in LetsChat:

Click "Basic Actions" in the Action step and here are the "Set Variable Value" and "Clear Variable Value".

Clear Custom Field / Clear JSON

To clear text, number, boolean, date, datetime variable, please use the Clear Custom Field action.

To clear JSON variable, please use the Remove All Items operation in the JSON Operation.

input value

"input value" operation is used to assign value to a variable. This operation works for any variable type.

TIP: "input value" for text variable can be used to connect several text variables. See the below picture for where to put original value and operated value.

Math Formula

With this operation, you can now do formula calculation directly in the Action Step - "Set Variable Value" and Condition Step - "Value".

Math operations and function supported:

+, -, *, e, pi, PI, abs(), min(), max(), ceil(), floor(), log(), pow(), round(), sqrt(), sin(), cos(), tan()

Please note that: If the formula is invalid, the system will return 0 to number variable and empty to text variable.

Set Text Variable

trim text

sub string

Note: Index starts from 0. Every character counts including space and punctuation.

replace string / replace string case sensitive

Note: In case sensitive situation, you have to put exactly "Hi" rather than "hi", "HI" or "hI".

to lower / upper case

generate random text

This feature is useful when you need to generate one-time verification code or reference code.

to URL friendly slug

Set Number Variable

get text length

generate random number

add / subtract / multiply / divide / modulus / power / natural logarithm / square root

TIP: in "natural logarithm", when you are calculating log2(8) = ? put 8 as "Value" and 2 as "Number".

Set DateTime Variable

from formatted text

add minutes / hours / days / weeks / months