Variable Operation
Channel Automation provides you with various built-in operations for variable modification.
There are 6 types of variable in Channel Automation:
Type | Storage | Example | Operation |
Text | letters, words, sentences... | Hi, Channel Automation. | cutting, change case, encode, decode... |
Number | number | 123.45 | + - x ÷, mod, power, log, root, round... |
Boolean | either "yes" or "no" | yes | assign |
Date |
date |
2021-03-30 | format, add months/weeks/days |
DateTime | date and time | 2021-03-30 16:52:00 | format, add months/weeks/days/hours/minutes |
JSON |
a series of variables |
{"name":"jack", "age":"10"} |
load, get, update, remove, count, sum, average, sort, shuffle, reverse... |
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.
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()
Set Text Variable
trim text
Description |
e.g. Before |
e.g. After |
---|---|---|
remove spaces before or after the text |
" abc" |
"abc" |
sub string
Description |
e.g. Before |
e.g. After |
---|---|---|
get part of the text |
"Hi, Channel Automation!" |
"Channel Automation" |
generate random text
Description |
e.g. Before |
e.g. After |
---|---|---|
as the name |
"code: XXXX-####-xxxx" |
"code: UBWT-3657-lkzb" |
url encode / decode
Description |
e.g. Before |
e.g. After |
---|---|---|
encode |
"Hi, Channel Automation!" |
"Hi%2C%20Channel%20Automation!" |
decode |
"Hi%2C%20Channel%20Automation!" |
"Hi, Channel Automation!" |
base64 encode / decode
Description |
e.g. Before |
e.g. After |
---|---|---|
encode |
"Hi, Channel Automation!" |
"SGksIFVDaGF0IQ==" |
decode |
"SGksIFVDaGF0IQ==" |
"Hi, Channel Automation!" |
to URL friendly slug
Description |
e.g. Before |
e.g. After |
---|---|---|
replace spaces with hyphens and remove the rest signs |
"it's a good day" |
"its-a-good-day" |
get text before/after
Description: get part of the text.
Type |
e.g. Before |
e.g. After |
---|---|---|
get text before another text |
name: Channel Automation, city: Melbourne |
name |
get text before last occur of another text |
name: Channel Automation, city: Melbourne |
name: Channel Automation, city |
get text after another text |
name: Channel Automation, city: Melbourne |
Channel Automation, city: Melbourne |
get text after last occur of another text |
name: Channel Automation, city: Melbourne |
Melbourne |
Description |
e.g. Before |
e.g. After |
---|---|---|
as the name |
n/a |
56 |
Description |
e.g. Before |
e.g. After |
---|---|---|
as the name |
7 |
8 |
round
Description |
e.g. Before |
e.g. After |
---|---|---|
as the name |
7.8693 |
7.87 |