Yes, there are special templates in Voximplant Kit for this purpose; using them, you can add working hours checking, convert the date format, round the retrieved values, etc.
Round up to a whole number. Numbers having more than 20 digits, written in exponential notation, and strings cause the error.
{{CEIL variable}}
For example, variable test = 2.344
{{CEIL 5.344}} >>> 6
{{CEIL test}} >>> 3
{{CEIL -1.1}} >>> -1
FLOOR
Round down to a whole number. Numbers having more than 20 digits, written in exponential notation, and strings cause the error.
{{FLOOR variable}}
For example, variable test = 2.344
{{FLOOR 5.344}} >>> 5
{{FLOOR test}} >>> 2
{{FLOOR -1.1}} >>> -2
CHECK_HOURS
Check if the time of a function call matches with the specified range.
{{CHECK_HOURS fromtotimezonetype}}
{{CHECK_HOURS '09:30''19:30''+3''all'}} >>> 1 or 0
COMPARE
Comparison of two values/variables.
The following comparison characters are supported: ==, != (means not equal), >, <, <=, >=
{{#COMPAREv1operatorv2}} if_true {{else}} if_false {{/COMPARE}}
It is mandatory to explicitly define values returned during comparison
(e.g., “yes” if the condition is met and “NO” otherwise)
{{#COMPARE\'test\'\'==\'\'tust\'}} true {{else}} false {{/COMPARE}} >>> false
For example, variable order_found = yes
{{#COMPAREorder_found\'==\'\'yes\'}}
order found {{else}}
order not found {{/COMPARE}}
>>> order found
CALC
Mathematical functions: addition, subtraction, multiplication, division.
{{#CALC}} equations {{/CALC}}
Variables inside CALC must be in curly brackets.
For example, variable price = 10
{{#CALC}}
' + '{{price}} * 5' + '{{/CALC}}
>>> 50
DATE_CONVERT
Date format conversion.
{{DATE_CONVERTdateold_formatnew_format}}
For example, variable order_data = 12:00 25.12.2019
{{DATE_CONVERTorder_data\'HH:mm DD.MM.YYYY\'\'DD/MM/YYY\'}}
>>> 25/12/2019
Original date 12:00 23.01.2018
Original format: HH:mm DD.MM.YYYY
Creating a new array from the values of the old array based on the key.
{{PLUCK arraykeyvalue}}
For example, variable array_sample
= [{"id": 1, "value": "q"}, {"id": 2, "value": "w"}, {"id": 3, "value": "e"}]
{{PLUCK array_sample'id'}}
>>> [1,2,3]
FILTERBY
Filter data by the specified parameter and its value. A new array is returned since a source array isn't mutated.
{{FILTERBY arraykeyvalue}}
For example, variable array_sample
= [{"id": 1, "value": "q"}, {"id": 2, "value": "w"}, {"id": 1, "value": "e"}]
{{FILTERBY array_sample'id'1}}
>>> [{"id":1,"value":"q"},{"id":1,"value":"e"}]
FINDBY
Find the first array element that satisfies the provided key value.
{{FINDBY arraykeyvalue}}
For example, variable array_sample
= [{"id": 1, "value": "q"}, {"id": 2, "value": "w"}, {"id": 3, "value": "e"}]
{{FINDBY array_sample'id'1}}
>>> {"id": 1, "value": "q"}
JOIN
Convert an array to a string with the specified delimiter.
{{JOIN arrayseparator}}
For example, variable test
= ["summer","autumn","winter","spring"]
{{JOIN test '|'}}
>>> summer|autumn|winter|spring
LENGTH
The length of the string/array.
{{LENGTH str}}
An array with single quotes [ 1 , 2 , 3 ] is treated as a string (LENGTH - 15).
For example, variable test_str = 'text example'
variable test_array = ["apple", "banana", "carrot", "coconut"]
variable test_obj = {"key1": 1, "key2": 2, "key3": 3}
{{LENGTH test_str}} >>> 12
{{LENGTH test_array}} >>> 4
{{LENGTH test_obj}} >>> 3 (number of keys)
LOWERCASE
Convert a string to lower case.
{{LOWERCASE str}}
For example, variable test = 'WONDERFUL order'
{{LOWERCASE test}} >>> wonderful order
UPPERCASE
Convert a string to upper case.
{{UPPERCASE str}}
For example, variable test = 'WONDERFUL order'
{{UPPERCASE test}} >>> WONDERFUL ORDER
PHONE_FORMAT
Remove all non-digits from the specified string.
{{PHONE_FORMAT str}}
For example, variable test = '+7-917 562 02 -34'
{{PHONE_FORMAT test}} >>> 79175620234
REPLACE
Replacing one value by another in the specified string.
{{REPLACE strAB}}
For example, variable test = 'John'
{{REPLACE 'Hello, my name is NAME''NAME'test}}
>>> Hello, my name is John
REVERSE
Reverse the specified string/array.
{{REVERSE variable}}
For example, variable test_str = 'Some text'
variable test_arr = [1,2,3,4,5]
{{REVERSE test_str}} >>> txet emoS
{{REVERSE test_arr}} >>> [5,4,3,2,1]
SORT
Sort the array values in ascending order. The numbers are sorted first then followed by the letters.
{{SORT array}}
For descending order use the option reverse = 1.
For example, variable test_array = ['banana', 'apple', 'coconut', 'carrot']
{{SORT test_array}} >>> ["apple","banana","carrot","coconut"]
{{SORT test_arrayreverse=1}} >>> ["coconut","carrot","banana","apple"]
SORTBY
Sort an array by a specific argument in ascending order.
{{SORTBY array key}}
For descending order use the option reverse = 1.
For example, variable array_sample = [{"id": 1, "value": "z"}, {"id": 2, "value": "a"}, {"id": 1, "value": "x"}]{{SORTBY array_sample 'value'}}
>>> [{"id":2,"value":"a"},{"id":1,"value":"x"},{"id":1,"value":"z"}]
SPLIT
Convert a string to an array regarding the specified delimiter.
{{SPLIT strseparator}}
For example, variable test = 'summer;autumn;winter;spring'
{{SPLIT test‘;’}} >>> ["summer","autumn","winter","spring"]