Template Functions
Built-in functions
Apart from the functions you can add via module, there are built-in functions, that are statically compiled and have no restrictions on the number of parallel calls they support. They are available in all templates.
| Function | Description | 
|---|---|
| replace(text: string, searchString: string, replacement: string) : string | Replaces all occurrences of a searchStringwithintext. | 
| sha1(text: string) : string | Returns the SHA-1 of text. The returned value is astringrepresenting the hexadecimal values of each byte in order of the resulted SHA-1 byte array. | 
| toLowerCase(text: string) : string | Returns same textwith all of its characters in lower case. | 
| uuid() : string | Returns a pseudo randomly generated UUID. | 
| emptyList(list : object[]) : boolean | Returns true if listcontains no elements. | 
| base64Encode(text: string) : string | Encodes textusing Base64 encoding scheme. | 
| base64Decode(text: string) : string | Decodes textusing Base64 encoding scheme. | 
| fromJsonArrayToIterable(jsonArray: string[]) : list<kv<string, object>> | Given a list of JSON documents, returns a list of key-value stores for each one. | 
| fromYamlArrayToIterable(yamlArray: string[]) : list<kv<string, object>> | Given a list of YAML documents, returns a list of key-value stores for each one. | 
| setVar(var: string, newVal : object) | Set the newValto variablevarin the current scope. | 
| consolePrint(message: string) | Prints a message to the console. | 
| recordExists(vdb: string, entity : string, filters : string) : boolean | Returns trueif at least one record in the in the Virtual Databasevdband Tableentity, that matches specificfilters. The format expected forfiltersparam is a semicolon separated list of filters in the formfield<operation>value, for examplemyfield=myvalueormyfield>100. | 
| getFirstMatchField(vdb: string, entity : string, field : string, filters : string) | Returns the value of column fieldusing same filtering criteria thanrecordExists. If the query returns more than one row, the function returns the first one. | 
| getSchemasByProperties(vdb: string, properties : string) string[] | Returns the list of schema names that contains specified properties. The format expected forpropertiesparam is a semicolon separated list of properties in the formproperty:value, for exampleazure_subscription:mysubscription. Whenvdbhas the special paramall, function searches in all registered Virtual Databases. | 
| getTablesByDirectives(vdb: string, schema : string, directives : string) string[] | Returns the list of table names of a specific schemawith specifieddirectives. The format expected fordirectivesparam is a semicolon separated list of names. Whenvdband/orschemacontain the special paramall, function searches in all registered Virtual Databases and Schemas respectively. | 
| getTablesByDirectivesAndValues(vdb: string, schema : string, directives : string) string[] | Returns the list of table names of a specific schemawith specifieddirectivesand values. Searching mechanism is the same as ingetTablesByDirectives, but this function expects also a directive value, in the formdirective:value, for examplesupports_idempotency:false. | 
| getTablesByTags(vdb: string, schema : string, tags : string) string[] | Returns the list of table names that contain specified tags. The format expected fortagsparam is a semicolon separated list of values. Whenvdband/orschemacontain the special paramall, function searches in all registered Virtual Databases and Schemas respectively. | 
Meta-functions
| Function | Description | 
|---|---|
| deferValueProcessing(contextVar : string) : object | This function creates a promise that ensures the value of the variable whose name in passed in contextVarwill be available in the context at some later point, preventing the parser from throwing an error when trying to replace by an not existent variable’s value. This works only in Action Endpoints definitions. |