Available functions

Config Register

${configRegister:[KEY]-[SUBKEY]}

->returns the value of the config register defined by [KEY]-[SUBKEY]

${configRegister:[KEY]-[SUBKEY],[fieldName]}

->returns the field value of the config register defined by [KEY]-[SUBKEY]

${currentObjectPure:[fieldName]}

-> returns the field value of the config register defined by [KEY]-[SUBKEY], but if some parameter contains another ${function}, it remains not evaluated

📘

Examples

${configRegister:STATUS-OPEN,name}
-> returns "Open" - i.e. the name of config register STATUS-OPEN

${configRegister:STATUS-OPEN, value.icon}
-> returns "fa-circle-notch" - i.e. the icon defined as parameter in JSON value config register STATUS-OPEN

${reg:[KEY]-[SUBKEY]}

->returns the value of the config register defined by [KEY]-[SUBKEY]

The difference between configRegister and reg is that reg is evaluated only once when compiling the final register for FE. This significantly speeds up FE operations, as the replacement has already taken place at the time the register is built and allows the atomization of the registers to be optimized. While configRegister is not evaluated until the runtime of the script

${joinRegArray:[KEY]-[SUBKEY],[KEY]-[SUBKEY],[KEY]-[SUBKEY]....[KEY]-[SUBKEY]}

->returns joinn of the config registers. All of them MUST be json array.

Clan, Family, Agency, Lists

${currentClan:[fieldName]}

-> returns value of [fieldName] of current clan (account), 

📘

Examples:

${currentClan:id}
-> returns id of current clan (account)

${currentClan:subdomain}.${currentClan:maindomain}
-> returns complete url of current clan (account)

${currentAgency:[fieldName]}

-> returns value of [fieldName] of current agency (business unit),

📘

Examples:

${currentAgency:id}
-> returns id of current agency (business unit)

${currentAgency:name}
-> returns name of current agency (business unit)

${currentAgency:company.name}
-> returns oficial name of current business unit from Contacts

${currentAgency:company.regOfficeAddress.street}
-> returns street of current business unit registration address

${currentAgency:company.regOfficeAddress.city} 
-> returns city of current business unit registration address

${currentAgency:company.regOfficeAddress.country}
-> returns ISO country of current business unit registration address (for example 'CZ')

${phrase:${list:countries,${currentAgency:company.regOfficeAddress.country},name}} 
-> returns country of current business unit registration address translated to current user lanuage

${configAgency:[id],[fieldName]}

-> returns value of [fieldName] of agency (business unit) found by ID,

${configAgencyCount}

-> returns the number of valid agencies (not DEMOs) in the clan. Used to hide UI elements that are only for multi-agency clans

${currentLicence:[fieldName]}

-> returns value of [fieldName] of current licence

${list:[listName]}

-> returns list identified by [listName]

📘

Examples:

${list:countries}
-> returns list of countries

${list:countrySelect}
-> returns list of countries in the form for select (list of JSON objects)

${list:states}
-> returns list of states

${list:statesSelect,US}
-> returns list of states for country "US" in the form for select (list of JSON objects)

${list:languages}
-> returns list of languages

${list:currencies}
-> returns list of currencies

Users

${setCurrentUserProperty:[name],[value]}

-> sets current user property of name [name] to value [value]

${currentUser:[fieldName]}

-> returns value of [fieldName] of current user

📘

Example:

${currentUser:id}
-> returns ID of current user

${currentUser:language}
-> returns language ISO code of current user

${currentUser:managerId}
-> returns ID of Manager of current user

${currentUser:firstName} ${currentUser:lastName} 
-> returns first and last name of current user

${currentUser:commonName}
-> returns common name of current user (order of first/last name is defined by FORMAT-COMMONNAME register)

${currentUser:properties. current user }
-> returns value of property propertyName]} of current user

${currentUser:properties.location}
-> returns value of property 'location' of current user

${currentUser:badges.roperty 'lo}
-> returns available badges (count of notifications), badgeName can be: process, chat and notification

${configUser:[id],[fieldName]}

-> returns value of [fieldName] of user with id = [id]. [id] can be one id or array of ids

📘

Example:

${configUser:

,managerId}
-> returns ID of Manager of user with id = rns

${configUser: of Ma,commonName}

-> returns common names array of users with id=1 and id=24

${isUserOnline:[id]}

-> returns true/false if user is/is not online

${configUserManager:[id],[fieldName]}

-> returns value of [fieldName] of Manager of user with id = [id],

${allConfigUserManagers:[id]}

-> returns list Managers and their Managers (All who is above in company hierarchy) of user with id = [id],

${allConfigUserListManagers:[ids]}

-> returns list Managers and their Managers (All who is above in company hierarchy) of list of users with ids = [ids],

${allConfigUserSubordinates:[id]}

-> returns list Subordinates and their Subordinates (All who is below in company hierarchy)

Groups

${configGroups:TEAM}

-> returns array of objects of all TEAM groups - used in breadcrumbs to complete team names

${configGroups:TEAM,${currentAgency:id}}

-> returns array of objects of all TEAM groups in the current Agency - used in breadcrumbs to complete team names

${configGroup:[id],[fieldName]}

-> returns value of [fieldName] group with id="[id]"

${configGroup:[name],[fieldName]}

->returns value of [fieldName] of group with name="[fieldName]"

📘

Examples:

${configGroup:Users,allUserIds}
->returns array of IDs of all members of goup with name="Users"

${configGroup:Finance supervisor,id}
->returns ID of group with name="Finance supervisor"

${configUserGroups:${currentUser:id},TEAM,name}
-> returns array of names of all TEAM groups the current user is member of

${configUserGroups:${currentUser:id},TEAM,id}

-> returns array of IDs of all TEAM groups where the current user is member of

${configUserGroups:[id1, id2, id3, id4],TEAM,allUserIds}

-> returns array of IDs of TEAM groups where the users [id1, id2, id3, id4] are member of

${configUserGroups:${currentUser:id},TEAM,allUserIds}

-> returns array of IDs of TEAM groups where the current user is member of

${isGroupMember:[groupName],[userId]}

-> returns true/false - if the user with ID=[userId] is member of group with name=[groupName]

${isCurrentUserSomeGroupMember:group1,group2...groupN}

-> returns true if the current user is a member of at least one of the listed groups

📘

Example:

${isGroupMember:Supervisor,${currentUser:id}}
-> returns true, if actual user is member of group "Supervisor"

Access controll test

${isApproved:[accessObject],[userId]}

-> returns true/false - if the user with ID=[userId] is approved for action in access object

📘

Example:

${isApproved:VIEW.RIGHTS-HR.ALL,custom.read,${currentUser:id}}
-> returns true, if current user is approved to perform the action (custom.read) defined in register VIEW.RIGHTS-HR.ALL

Actual module / document / object

${currentModule}

-> returns name of module where the user actually is (documents, jobs, tasks, contacts)

A currentObject is assigned to each configuration, sometimes also a parentObject or dataObject (if you need to refer to object different from currentObject)

${currentObject}

-> returns whole actual object (JSON)

${currentObject:[fieldName]}

-> returns specific field with name=[fieldName] from currentObject

${currentObject:properties.[propertyName]}

-> returns specific property with name=[propertyName] from currentObject

${currentObjectStr:[fieldName]}

-> returns specific field with name=[fieldName] from currentObject, but as STRING, even the data are numeric

${currentObjectPure:[fieldName]}

-> returns specific field with name=[fieldName] from currentObject, but if some parameter contains another ${function}, it remains not evaluated

📘

Examples:

${currentObject:status}
-> return value of status field from currently opened entity

${currentObject:properties.currencyDoc}
-> return value of property with name "currencyDoc"

Working with the editable table in the document

${editTableData:bodyEditTable-[name].data.[row].[column]}

-> returns the value of a cell from a table named [name], from row [row], column [column]
As a line number we can use the value "lastIndex" instead of a numeric index, where the value of the last line is automatically returned. The last line is usually the summary line.

${editTableValueColumnValues:bodyEditTable-[name],[column],[unique]}

-> returns an array of values from table [name], from column [column], and if [unique] is true, duplicates are excluded

📘

Examples:

${editTableData:bodyEditTable-DUE.data.0.totalDueDoc}
-> returns the value from the DUE table of row 0 and the totalDueDoc column

${editTableData:bodyEditTable-DUE.data.lastIndex.totalDueDoc}
-> returns the value from the DUE table from the last (sum) row and the totalDueDoc column

${editTableValueColumnValues:bodyEditTable-CASHBOX.DEBIT.BILL.ITEMS,jobOwnerId,true}
-> returns an array of unique values (without duplicates) from the CASHBOX.DEBIT.BILL.ITEMS table, from the jobOwnerId column

${editTableData:bodyEditTable-INVOICE.PURCHASE.ITEMS.data.lastIndex.amountOverQuote}
-> returns the value from the INVOICE.PURCHASE.ITEMS table from the last (sum) row and the amountOverQuote column, which is the sum of all amounts over the budget.

More complex example: lookup of job numbers from the invoice editing table:
${evaluate:let data = JSON.parse(${editTableValueColumnValues:bodyEditTable-${currentObject:type}.ITEMS,itemNumber,true});data.forEach((element, index) => data${curre = element.split('.')ite );mber,true});data.f.join(', ')}

Lookup the list of users from the editing table.
In some cases, it is necessary that all owners of orders to which the invoice has been matched have guaranteed access to the invoice. Then it is possible to look up the id of these users from the jobOwnerId column from this table (if such a column exists in the editing table). This user list can then be added to the entity's ENTITY.RIGHTS as follows:
"userIds": list of users from the editing table.

In some cases, it is necessary that all owner,

Set field, array, property value

${setField:[fieldName],[fieldValue]}

-> Sets the [fieldName] field to [fieldValue]. This is usable only for fields in main object, not in properties object. For setting propertu use the following construction

If this is used in Actionbar, there is differen addressing the currentObject.
There must be used this: ${setField:data.[fieldName],[fieldValue]}

${setField:properties.[propertyName].value,[propertyValue]}

-> Sets the [propertyName] field to [propertyValue]

📘

Examples:

${setField:status,DONE}
-> sets value of status field to 'DONE'

${setField:properties.issueDate.value,${computeDate:Today}}
-> sets value of property issueDate to todays date

It is also possible to use the .allIndexes convention, which ensures that it is written to all elements of the array.

📘

Examples:

I have a regular "street" field and I want to set it to the value "King street"
${setField:street,King street}

I have an array of objects "addressList", I want to set the "isDefault" parameter to true for the FIRST element (index = 0).
${setField:addressList.0.isDefault,true}

I have an array of objects "addressList", I want to set the "isDefault" parameter to true for ALL of them.
${setField:addressList.allIndexes.isDefault,true}

I have an array of objects "addressList", I want to set the "isDefault" parameter to true for the LAST element
${setField:addressList.lastIndex.isDefault,true}

${setFieldIf:[fieldName],[condition],[ifTrue],[ifFalse]}

-> Conditional field value setting

📘

Examples:

${setFieldIf:categoryList.allIndexes.isDefault,references.tempObject.id==${currentObject:categoryList.${dataObject:index}.id},true,false}
-> goes through all the elements in the categoryList, and if the condition matches, sets them to true, otherwise false

It is used for the case when I have an array of objects and in only one I want to set to default, in all others it must be set that they are not default. This is used, for example, on the config page to set which of the categories is the default

${setArray:[fieldName],value1, value2, value3...valueN}

-> Sets values to an Array field

📘

Example:

${setArray:acl.custom.write.groups,${configGroup:Finance supervisor,id}}
-> setts the access rights field in the document to a group Finance supervisor

${addToArray:[fieldName],value1, value2, value3...valueN}

-> Adds values to an Array

📘

Example:

${addToArray:acl.custom.read.users,${configUser:${currentObject:ownerId},managerId}}
-> adds to the access rights field in the document manager of document owner

${setDraft:[draftReason],[value]}

-> sets the DRAFT flag on the document

The resulting Draft flag of the entire document is a logical evaluation of individual flags, of which there can be more. If any DRAFT (dratfReason) flag is set to true, the entire document has the DRAFT = TRUE flag

📘

Example in process:

At the beginning of the process, I will set up:
${setDraft:Document is not approved,true}
therefore, the document is printed with the DRAFT flag until it is approved by the responsible person

Once the responsible person approves the document in the process
${setDraft:Document is not approved,false}
this eliminates the DRAFT flag (unless there is another draftReason = true)

Search in object array in entity

${findInArray:[arrayOfObjects],[searchedAttribute],[searchedValue]}

-> serach the [arrayOfObjects] for [searchedAttribute] =[searchedValue], returns found object

${findInArray:[arrayOfObjects],[searchedAttribute],[searchedValue],[requestedAttribute]}

-> serach the [arrayOfObjects] for [searchedAttribute] =[searchedValue], returns [requestedAttribute] value

📘

Examples:

data in currentObject:
registrationList: Object:

registrationList: [ {name: 'Company ID', value: '123'}, {n

I need to search in this array for an element where its 'name' is 'VAT ID'

${findInArray:currentObject,registrationList,name,VAT ID}
-> returns found object: {name: 'VAT ID', value: '456'}

If I only need some attribute from the found element, then I will use an additional optional parameter nd element, then I w, ie:

${findInArray:currentObject,registrationList,name,VAT ID,value}
-> returns: 456

Process on entity

${currentProcess:[fieldName]}

-> returns specific parameter [fieldName] from process in actually opened entity

📘

Examples:

${currentProcess:processOwnerIDs}
-> returns array of IDs of the process owner

${currentProcess:processInitiatorID}
-> returns ID of the process initiator

${currentProcess:previousActivityOwnerIDs}
-> returns array of IDs of owners the previous activity

${currentProcess:previousActivityPerformerID}
-> returns ID of the prrevious activity performer

Contacts lookup

${getPersonList:[companyId]}

-> returns array of objects of persons belonging to company with ID=[companyId]

${getBrandList:[companyId]}

-> returns array of objects of brands belonging to company with ID=[companyId]

${getBankAccountList:[companyId]}

-> returns array of objects of bank accounts belonging to company with ID=[companyId]

Financial operations

${currencyRate:[sourceCurrency],[targetCurrency],[date]} (available for BackendOnly)

-> returns currency rate from [sourceCurrency] to [targetCurrency] for the specified [date]

The function uses a configured source of exchange rates. If no rate is available in the source for the day, it returns the rate of the first previous day for which a rate is available. One of the currencies must be the same as the configured accounting currency. If a pair of currencies is used and neither is the accounting currency, the function returns a rate of 0.

📘

Examples:

CZK is the configured accounting currency
${currencyRate:EUR,CZK,2023-03-01} returns 24.500
${currencyRate:CZK,EUR, 2023-03-01} returns 0.0408
${currencyRate:CZK,CZK, 2023-03-01} returns 1
${currencyRate:EUR,USD, 2023-03-01} returns 0

Comparison functions

${isEqual:parameter1,parameter2}

-> Compares parameters for equality. Parameters can be either a number or a string.

${isNotEqual:parameter1,parameter2}

-> Compares parameters for negative equality. Parameters can be either a number or a string.

${isLessOrEqual:parameter1,parameter2}

-> Compares parameters. Parameters must be a number.

${isMoreOrEqual:parameter1,parameter2}

-> Compares parameters. Parameters must be a number.

Logical operations

${and:parameter1,parameter2,,,parameterN}

-> Evaluates the AND logical expression

${or:parameter1,parameter2,,,parameterN}

-> Evaluates the OR logical expression

${not:parameter}

-> Evaluates the NOT logical expression

Number operations

${mathPlus:[augend],[addend]}

-> Add numbers correctly without floating point errors.

${mathMinus:[minuend],[subtrahend]}

-> Subtracts numbers correctly without floating point errors.

${mathMultiply:[multiplicand],[multiplier]}

-> Multiplies numbers correctly without floating point errors.

${mathDivide:[dividend],[divisor]}

-> Divides numbers correctly without floating point errors.

${mathSum:[augend],[addend],[addend],[addend],...[addend]}

-> Summarizes numbers correctly without floating point errors.

${round:[input],[number],[fix]}

-> rounds [input] to [number] decimal places. The third parameter is optional (default = false). If true, displays a fixed number of decimal places to which it has been rounded.

${formatNumber:[input]‌,[language],[decimals],[showAlwaysDecimals]},

-> returnf formated number [input] where:

  • [language] optional parameter - ISO language, if not specified, the user's language is taken
  • [decimals] optional parameter - requested number of decimals, if not specified default value is 2
  • [showAlwaysDecimals] optional parameter - if true decimals are always shown, even if .00, if not specified default value is true
  • detail format parameters are here http://numeraljs.com/

📘

Examples:

${formatNumber:123456.789}
-> returns for user language "en" value 123,456.78
-> returns for user language "cs" value 123 456,78

${hideZero:[input]}

-> return empty string if [input] = 0

String operations

${strIncludes:string,substring}

-> Determines whether a string contains a substring

${stringMaxLenght:[length],[longString]}

-> returns [longString] shortened to maximum of [length] characters (only for backend functions)

${phrase:[enPhrase]}

-> returns [enPhrase] translated to user language and context DEFAULT

${phrase:[enPhrase],[languageCode]}

-> returns [enPhrase] translated to language [languageCode] and context DEFAULT

${phrase:[enPhrase],[language code], [context]}

-> returns [enPhrase] translated to user language and context [context]

${phrasePlural:[number],[singularEnPhrase],[pluralEnPhrase]}

-> returns [enPhrase] translated to user language and regarding the [number] selects the right plural translation

📘

Examples:

${phrasePlural:0,week,weeks}
-> returns for 'cs' language '0 týdnů'

${phrasePlural:2,week,weeks}
-> returns for 'cs' language '0 týdny'

${phrasePlural:10,week,weeks}
-> returns for 'cs' language '10 týdnů'

${splitToCharGroups:[input],N}

-> returns input splitted into groups of characters every group has N characters

📘

Example:

${splitToCharGroups:abcdefghijklmnopqrstuvwxyz,3}
-> returns 'abc def ghi jkl mno pqr stu vwx yz'

${trim:[input]}

-> returns a string adjusted for leading and trailing spaces

📘

Example:

${trim:    aaa      bbb    cccc   }
-> returns 'aaa      bbb    cccc'

${superTrim:[input]} - vrátí řetězec očištěný o úvodní mezery, závěrečné mezery, dvojité mezery  příklad "   aaa      bbb    cccc   " → "aaa bbb cccc"

📘

Example:

${superTrim:   aaa      bbb    cccc   }
-> returns "aaa bbb cccc"

${strReplace:[input],[fromString],[toString]}

-> returs replaced string, where:

  • [input] original string
  • [fromString] find all occurrences of this substring
  • [fromString] also be defined as REGEX (without /) example: /[^0-9]+/g   state as:  [^0-9]+
  • [toString] optional parameter -substring to be replaced

📘

Examples:

${strReplace:KEY-SUBKEY,^.*[-],}
-> returns 'SUBKEY'

${strReplace:KEY-SUBKEY,KEY-,}
-> returns 'SUBKEY'

${strReplace:abc123def456,{strRe+}
-> all non numeric characters are removed - returns '123456'

${strReplace:123@#456,racters are r}
-> all non numeric or alphabetical characters are removed - returns '123456'

${strReplace:JOB-000123.0,\.0}
-> remove all occurences of ".0" - returns 'JOB-000123'

${strReplace:JOB-000123.0,\.0$}
-> remove ".0" at the end of string - returns 'JOB-000123'

${safeText:HELLO,/@#$%^&()-=][¤;><12345}
-> remove specified symbols - returns 'HELLO-12345'

${strToAscii:[string]}

-> converts the [string] into ASCII characters by finding the most similar characters without local diacritics

${lowerCase:[string]}

-> converts the [string] into lower case

${base64Encode:[string]}

-> encode the [string] into base64 encoded string

${base64Decode:[string]}

-> decode the [string] from base64 encoded string

${upperCase:[string]}

-> converts the [string] into upper case

${sentenceCase:[string]}

-> converts the [string] into sentence case (first characrer uppercase, other lowercase)

${titleCase:[string]}

-> converts the [string] into title case (first characrer of every word uppercase)

${camelCase:[string]}

-> converts the [string] into camelCase (removes all spaces and underscores and next character to Uppercase)

${htmlToText:[html]}

-> removes all html tags from the string

${escapeQuotes:[string]}

-> replaces all " to \";

${unEscapeQuotes:[string]}

-> replaces all \" to ";

${randomString:[lenght]}

-> returns the random string of the length of [lenght]

Date operations

${formatDateTime:[datetime],[formatString],[language]}

-> format ISI DATE-TIME [datetime] into reqested [formatString]

  • [formatString] format parameters described here: https://momentjs.com/
  • [language] is optional parameter, if not specified, current user language will be used

📘

Examples:

${formatDateTime: ${form,L HH:mm}
-> returns "09.07.2015 01:30"

${formatDateTime:.2015 0,L}
-> returns "09.07.2015"

${formatDateTime:2015-07-19T00:30:00,l LT}
-> returns "19. 7. 2015 0:30"

${formatDateTime:2015-07-19T00:30:00,L}
-> returns "19. 7. 2015" 

${formatDateTime:2015-07-19T00:30:00,LT}
-> returns "0:30"

📘

TIP - display UTC time as Local time for user

All timestamps comming from backend are ISO timestamps without timezone mark. If you want to display timestamp for user in current user local timezone, it helps to add Z (=UTC) mark to the timestamp. Example:

${formatDateTime:2015-07-19T00:30:00,l LT}
-> returns "19. 7. 2015 0:30" because the timestamp not contain timezone info

${formatDateTime:2015-07-19T00:30:00Z,l LT}
-> returns "19. 7. 2015 2:30" because the timestamphave the Z mark

so for example:

${formatDateTime:${dataObject:created_timestamp}Z,L HH:mm}

-> shows the created_timestamp in user timezone

Following functions returns ISO DATE

${convertDate:[date],D.M.Y}

-> ONLY IN BACKEND - converts date from any date format with any delimiter into ISO date - this is useful when parsing in the adapter from data sources that have dates formatted in different national formats

📘

Examples

${convertDate:1.3.22,D.M.Y} => 2022-03-01

${convertDate:22.3.1,Y.M.D} => 2022-03-01

${convertDate:22/3/1,Y/M/D} => 2022-03-01

${convertDate:22-3-1,Y-M-D} => 2022-03-01

${computeDate:Today}

-> returns specified date (ISO DATE)

${computeDate:Yesterday}

-> returns specified date (ISO DATE)

${computeDate:Tomorrow}

-> returns specified date (ISO DATE)

${computeDate:FirstDayWeek,date}

-> returns specified date (ISO DATE) of first day of the week, where date is

${computeDate:LastDayWeek,date}

-> returns specified date (ISO DATE) of last day of the week, where date is

${computeDate:FirstDayMonth,date}

-> returns specified date (ISO DATE) of first day of the month, where date is

${computeDate:LastDayMonth,date}

-> returns specified date (ISO DATE) of last day of the month, where date is

${computeDate:FirstDayThisMonth}

-> returns specified date (ISO DATE)

${computeDate:LastDayThisMonth}

-> returns specified date (ISO DATE)

${computeDate:FirstDayLastMonth}

-> returns specified date (ISO DATE)

${computeDate:LastDayLastMonth}

-> returns specified date (ISO DATE)

${computeDate:FirstDayNextMonth}

-> returns specified date (ISO DATE)

${computeDate:LastDayNextMonth}

-> returns specified date (ISO DATE)

${computeDate:FirstDayThisQuarter}

-> returns specified date (ISO DATE)

${computeDate:LastDayThisQuarter}

-> returns specified date (ISO DATE)

${computeDate:FirstDayLastQuarter}

-> returns specified date (ISO DATE)

${computeDate:LastDayLastQuarter}

-> returns specified date (ISO DATE)

${computeDate:FirstDayNextQuarter}

-> returns specified date (ISO DATE)

${computeDate:LastDayNextQuarter}

-> returns specified date (ISO DATE)

${computeDate:FirstDayThisYear} and ${computeDate:FirstDayThisFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:LastDayThisYear} and ${computeDate:LastDayThisFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:FirstDayLastYear} and ${computeDate:FirstDayLastFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:LastDayLastsYear} and ${computeDate:LastDayLastFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:FirstDayNextYear} and ${computeDate:FirstDayNextFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:LastDayNextYear} and ${computeDate:LastDayNextFiscalYear}

-> returns specified date (ISO DATE)

${computeDate:FirstDayYear,date} and ${computeDate:FirstDayFiscalYear,date}

-> returns specified date (ISO DATE) of first day of the year, where date is

${adjustDate:${computeDate:Today},1,days}

-> returns specified date + 1 day (ISO DATE), parameter 'days' is optional, default is days. you can set here days, months, years

${adjustDateWD:${computeDate:Today}, 1 }

-> returns specified date + 1 working day (ISO DATE)

${timestampToDate:[timestamp]}

-> returns converted timestamp from integer format into (ISO DATE)

Following functions returns ISO DATE-TIME

${computed:currentDateTime}

-> returns specified date time (ISO DATE-TIME)

${timestampToDateTime:[integerTimestamp]}

-> returns converted INTEGER-TIMESTAMP into date time (ISO DATE-TIME)

Following functions returns TIMESTAMP (format integer)

${dateTimeToTimestamp:${computeDate:Today}}

-> returns timestamp of specified day at 00:00 (INTEGER-TIMESTAMP)

${computed:timestamp}

-> returns actual timestamp (INTEGER-TIMESTAMP)

Other date-time functions

${computed:currentYear}

-> returns acrual year

${secondsToHours:[seconds]}

-> converts INTEGER-TIMESTAMP into readable HOURS:MINUTES

${isWeekend:[YYYY-MM-DD]}

-> returns true, if [YYYY-MM-DD] is weekend day

${weekdayNumber:[YYYY-MM-DD]}

-> returns ISO numeric day of the week: 1 (for Monday) - 7 (for Sunday)

${weekday:[YYYY-MM-DD]}

-> returns lowercase name of day of the week in user language: for example "wednesday"

Sort & Search array

${search:[arrayOfObjects],[searchSource],[searchString]}

-> returns searched array of objects. Search source is name of the column or array of column names where search will be performed, search string is the string which will be searched.

  • name of parameter / column - for example 'name'
  • complex instruction array - for example: ["name", "address"]

${sort:[arrayOfObjects],[sortInstriction]}

-> returns sorted array of objects. Sort instruction can be:

  • name of parameter / column - for example 'name'
  • complex instruction array - for example: ["column": "name", "sort": "asc"]

📘

Examples:

"searchedList": ${search:${currentObject:originalList},name,${currentObject:searchString}}

"sortedList": "${sort:${currentObject:originalList},name}"

Conditions

${if:[condition],[resultTrue],[resultFalse]}

-> evaluates the [condition]. If result is true, the [resultTrue] is returned. [resultFalse] is optional. If result is false, the [resultFalse] is returned

${evaluate:[condition] ? [resultTrue] : [resultFalse] }
-> evaluates the [condition]. If result is true, the [resultTrue] is returned. [resultFalse] is optional. If result is false, the [resultFalse] is returned

📘

Examples:

${if:10>11,A,B}
-> returns 'B'

${evaluate:(10 > 11)? 'A' : 'B'}
-> returns 'B'

${evaluate:(${currentObject:costAmount} > ${currentObject:costQuote})} - vyhodnotí daný výraz

${isTrue:[condition]}

-> evaluates the [condition] and returns true if condition is evaluated as true or "true", otherwise returns false

${isFalse:[condition]}

-> evaluates the [condition] and returns true if condition is evaluated as false or "false", otherwise returns false

📘

Examples:

${if:String(${parentObject:properties.showColumnCategory})=='true',A,B}
this is not elegant way how to securely evaluate condition, which can be evaluated as true, false, null or undefined

With isTrue its more readable and secure:
${if:${isTrue:${parentObject:properties.showColumnCategory}},A,B}


${switch:[expression],case1:result1,case2:result2...,caseN:resultN,resultDefault}

-> evaluates the [expression] and returns result of this expression, else returns default result

API call

${callApi:[method],[path],[body],[parameter],[allow]}

-> calls the API method [method] - GET / POST / PUT of the given url [path] and places the json defined in [body]. [body] must be in the extra register, the register is entered as KEY-SUBKEY. [parameter] is optional. if I specify a parameter name, it returns only the value of that parameter. If I specify 0 and the result of the api call is an array of objects, only the 0th element of the array is returned. The parmeter [allow] is optional, if false, the api will not be called.

📘

Example:

${callApi:post,views/${currentClan:id}/${currentAgency:id}/1/getViewData,API.BODY-COMPANIES}
-> returns data from view

Other functions

${isNewDoc}

-> in entity (document, job, task..) returns true if the entity is new, not saved

${isDisabledDoc}

-> in entity (document, job, task..) returns true if the entity is in readmode (not being edited)

${isNaN:[value]}

-> returns true if value is NaN (Not a Number)

${isEmpty:[value]}

-> returns true if value is empty

${formatBytes:[value]}

-> converts file size in bytes to human-readable string, for example 10 MB

${listLength:[value]}

-> returns 0 if value is empty or empty array. IF value is array, returns number of elements in array

${join:[array]}

-> returns array values joined into one string, determined by comma

${hash:[input]}

-> hashes the [input]

${jsonParse:[stringifiedJson]}

-> parse [stringifiedJson] into valid JSON.

${playSound:[filePath],[volume]}

-> plays the sound saved in Teamogy CDN. Sounds from another sources are not allowed. [volume] is number in the range of 0-1, for example 0.5

Frontend user information box / notification

${infoBox:[type],[header],[message],[allow]}

-> displays the infobox of [type] defined in register INFOBOX.RULE-DEFAULT, where [header] and [message] is displayed. the parmeter [allow] is optional, if false, the infobox is not displayed

${notify:[message],[scheme],[icon]}

-> displays the overlay notification on top right part of screen. Scheme is color scheme, for example "scheme-green" icon is Font Awesome icon. Parameters cheme and icon are optional.

UX and responsivity related fuctions

${currentColorScheme}

-> returns color scheme of user - DARK (dark), LIGHT (light), BLACK&WHITE (bw), BLACK&WHITE inverted (bwi)

${environment:zoom}

-> returns the user configured font size - number, default = 10

${environment:screen}

-> returns the window width in pixels

${environment:platform}

-> returns the user platform (OS): Windows, MacOS, Linux, Android, iOS, Unknown

${environment:appType}

-> returns the info if user is in browser or in app. Returns: browser / native / pwa

${environment:hasMouseSupport}

-> returns [boolean] true if device has mouse support

${environment:hasTouchSupport}

-> returns [boolean] true if device has touch support

${environment:screenWidth}

-> returns device screen width in pixels

${environment:screenHeight}

-> returns device screen height in pixels

${breakpoint:xxs}

-> returns defined breakpoint (xxs, xs, s, m, l, xl) in pixels of screen width

${convertToPixels:[input]}

-> returns input converted to pixels. [input] can be: 10px, 10rem, 10vw, 10vh output is number of pixels

📘

Example:

"hidden": "${evaluate:${environment:screen}<=${breakpoint:xxs}}",
-> the element will be hidden in xss screens (mobiles)

Evaluate Javascript

${evaluate:[javascript]}

-> evaluates the [javascript] and returns the result

${evaluateRegister:KEY-SUBKEY,{evalParams Object}}

-> evaluates the [javascript] in external register KEY-SUBKEY. The advantage of an external register is that you can write complex javascript, whereas writing javascript directly into the evaluate function means being limited to writing it in a single line. {evalParams Object} is optional. Tn the javascript, the evalParams object is accessible as evalParams

📘

Examples:

${evaluate:references.getConfigRegisterValueByKeySubKey('HIDDEN-BINDER')}
-> returns false - the value of the register HIDDEN-BINDER

${if:${evaluate:var statuses = references.getConfigRegisterValueByKeySubKey('LIST-TASK.STATUS.TERMINAL'); (statuses.includes('ueByKeyS') || statuses.includes('ERMINAL'); ('))},true,false}
-> returns the result of the evaluated javascript

Convert value type in template

${asNumber:[number]}

-> returns [number] as number, without quotes. works perfectly in export templates, where json editor cannot allow write magic function without quotes

${asBoolean:[boolean]}

-> returns [boolean] as boolean, without quotes.

${asJson:[json]}

-> returns [json] as json, without quotes.

📘

Examples:

template has following attribute

"theNumber": "${currentObject:number}"
-> normally returns - "theNumber": "333"

"theNumber": "${asNumber:${currentObject:number}}"

-> returns - "theNumber": 333 (doble quotes from template are deleted)

File downloads

${downloadFile:[url]}

-> only on front end. Downloads any file defined my URL

${downloadS3File:[key]}

-> only on front end. Downloads file from S3 defined my KEY