1. Home
  2. Flow Builder
  3. Steps
  4. Steps
  5. Variable Operation
Last updated 462 days ago

Variable Operation

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

There are 6 types of variable:

TypeStorageExampleOperation
Textletters, words, sentences…Hi, Konversation.cutting, change case, encode, decode…
Numbernumber123.45+ – x ÷, mod, power, log, root, round…
Booleaneither “yes” or “no”yesassign
Datedate2021-03-30format, add months/weeks/days
DateTimedate and time2021-03-30 16:52:00format, add months/weeks/days/hours/minutes
JSONa 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.

“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

condition

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()

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

Set Text Variable

Trim text

Descriptione.g. Beforee.g. After
remove spaces before or after the text” abc ““abc”

Sub string

Descriptione.g. Beforee.g. After
get part of the text“Hi, Konversation!”“Konversation”

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

Replace string / replace string case sensitive

Descriptione.g. Beforee.g. After
replace part of the text“Hi, Konversation!”“Hello, Konversation!”

In case sensitive situation, you have to put exactly “Hi” rather than “hi”, “HI” or “hI”.

To lower / upper case

Typee.g. Beforee.g. After
to lower case“Hi, Konversation!”“hi, Konversation!”
to upper case“Hi, Konversation!”“HI, Konversation!”

Generate random text

Descriptione.g. Beforee.g. After
as the name“code: XXXX-####-xxxx”“code: UBWT-3657-lkzb”

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

url encode / decode

Typee.g. Beforee.g. After
encode“Hi, Konversation!”“Hi%2C%20Konversation!”
decode“Hi%2C%20Konversation!”“Hi, Konversation!”

Base64 encode / decode

Descriptione.g. Beforee.g. After
encode“Hi, Konversation!”“SGksIFVDaGF0IQ==”
decode“SGksIFVDaGF0IQ==”“Hi, Konversation!”

To URL friendly slug

Descriptione.g. Beforee.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.

Typee.g. Beforee.g. After
get text before another textname: Konversation, city: Melbournename
get text before last occur of another textname: Konversation, city: Melbournename: Konversation, city
get text after another textname: Konversation, city: MelbourneKonversation, city: Melbourne
get text after last occur of another textname: Konversation, city: MelbourneMelbourne

Set Number Variable

Get text length

Descriptione.g. Beforee.g. After
as the name500.596

Generate random number

Descriptione.g. Beforee.g. After
as the namen/a56

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

Descriptione.g. Beforee.g. After
as the name78

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

Round

Descriptione.g. Beforee.g. After
as the name7.86937.87

Floor / ceil

Description: get approximate integer.

Typee.g. Beforee.g. After
floor6.556
ceil6.557

Set DateTime Variable

From formatted text

Descriptione.g. Beforee.g. After
get DataTime value from formatted text00:00:00 30th Aug, 20202020-08-30 00:00:00

Add minutes / hours / days / weeks / months

Descriptione.g. Beforee.g. After
as the name2021-01-01 00:00:002021-01-01 00:01:00
Was this article helpful to you? No Yes

How can we help?