You can benefit various functions when designing your app on Kuika Designer. You can make use of a bunch of predefined functions or you can add a new function of your own. Functions make it easy to call and run units of work repeatedly in your app design.

You can add new functions for your domain through Kuika Management portal, or you can use built in functions of Kuika domain in all your domains.

Basic Type Functions

String Functions

Syntax

STRLENGTH(word)

Definition

Returns length of the string word.

Return type: Integer.

Parameters
wordType: String. Required.
Example
wordFormulaResult
“Kuika”LENGTH(word)5
“Software”LENGTH(“Software”)8

Syntax

LIKE(word, pattern)

Definition

Checks if word contains a substring matching with pattern. Returns true or false.

Parameters
wordType: String. Required. Base string to match the pattern.
patternType: String. Required. Substring to be matched against in word.
Example
wordpatternFormulaResult
“Low Code”“Co”LIKE(word, pattern)true
“Low Code”“Coder”LIKE(word, pattern)false
Syntax

FIND(substring, string, starting_index)

Definition

Returns true if substring exists in string within indices starting from starting_index to the end of the word string. If starting index is not specified, ust checks within the whole string.

Return Type: Boolean

Parameters
substringType: String. Required. String to be searched.
stringType: String. Required. String to perform the search operation inside.
starting_indexType: Integer. Optional. The index number that specifies the position to start searching in the string.
Example
substringstringstarting_indexFormulaResult
“windo”New windowFIND(substring,string)true
“windo”New window2FIND(substring,string,starting_index)true
“windo”New window5FIND(substring,string,starting_index)false

Syntax

LOWER(word)

Definition

Returns a new string as the lower-cased version of string word.

Return Type: String

Parameters
wordType: String. Required. String to be made lower-case..
Example
wordFormulaResult
“Innovation”LOWER(“Innovation”)“innovation”
Syntax

SUBSTITUTE(string, substring, new_substring)

Definition

Creates and returns a new string that is created by replacing a substring in a string by new_substring.

Return Type: String

Parameters
stringType: String. Required. The whole string.
substringType: String. Required. The string to be replaced.
new_substringType: String. Required. The string that replaces substring.
Example
stringsubstringnew_substringFormulaResult
“Innovation”“on”“ve”SUBSTITUTE(string, substring, new_substring)“Innovative”
“All that we see or seem is but a dream within a dream.”“see or seem”“know”SUBSTITUTE(string, substring, new_substring)“All that we know is but a dream within a dream.”

Syntax

REPLACE(string, from_index, to_index, new_substring)

Definition

Creates and returns a new string that is created by replacing a substring between indices from_index and to_index, in a string by new_substring.

Return Type: String

Parameters
stringType: String. Required. The whole string.
from_indexType: Integer. Required. Starting index to replace.
to_indexType: Integer. Required. Ending index to replace.
new_substringType: String. Required. The string that replaces substring between indices from_index and to_index.
Example
stringfrom_indexto_indexnew_substringFormulaResult
“Michelangelo’s David”011“Bernini”REPLACE(string, 0,11,, new_substring)“Bernini’s David”
Syntax

CONCATENATE(firstword, secondword)

Definition

Concatenates two strings firstword and secondword, then returns it as a new string.

Return Type: String

Parameters
firstwordType: String. Required.
secondwordType: String. Required.
Example
firstwordsecondwordFormulaResult
“Welcome to ” “Kuika!”CONCATENATE(firstword,secondword)“Welcome to Kuika!”

Syntax

CHAR(number)

Definition

Converts an integer number into a text and returns it.

Return Type: String

Parameters
numberType: Integer. Required.
Example
numberFormulaResult
123456CHAR(123456)“123456”
Syntax

NEWGUID()

Definition

Generates and returns a new Guid.

Return Type: Guid

Example
FormulaResult
NEWGUID()054992f1-452a-4281-87d3-48d93fc35617

Syntax

TOSTRING(object)

Definition

Converts any type of object into String format and then returns that new string.

Return Type: String

Parameters
objectRequired.
Example
objectFormulaResult
123456TOSTRING(123456)“123456”

Syntax

CLEAN(text)

Definition

Strips non-printable ASCII characters in the text, and returns text after modification.

Return Type: String

Parameters
textType: String. Required. The string modified to be free from non-printable ASCII characters.
Example
textFormulaResult
“NULL.hel+SHlo!” (Suppose NULL and SH refer to NULL character, and Shift character, respectively, which are non-printable ASCII characters.)CLEAN(text)“.hel+lo!”

Date Functions

Syntax

TODAY()

Definition

Returns the current date and time information.

Return Type: DateTimeOffset

Example
FormulaResult
TODAY()Wednesday, August 2, 2017 04.25 PM
Syntax

DATETOSTRING(date)

Definition

Returns date object formatted as text.

Return Type: String

Parameters
dateType: DateTimeOffset. Required.
Example
dateFormulaResult
Wednesday, August 2, 2017 04.37 PMDATETOSTRING(date)“Wednesday, August 2, 2017 04.37 PM”

Syntax

ADDMINUTES(date, minutes)

Definition

Adds minutes to date and returns a new DateTimeOffset object.

Return Type: DateTimeOffset

Parameters
dateType: DateTimeOffset. Required.
minutesType: Integer. Required.
Example
dateminutesFormulaResult
Wednesday, August 2, 2017 04.37 PM128ADDMINUTES(date,minutes)“Wednesday, August 2, 2017 06.45 PM”
Syntax

DATEDIFFERENCEINDAYS(firstdate, seconddate)

Definition

Takes difference of two date objects and returns as number of days. If result is not an Integer, rounds it up.

Return Type: Integer

Parameters
firstdateType: DateTimeOffset. Required.
seconddateType: DateTimeOffset. Required.
Example
firstdateseconddateFormulaResult
Wednesday, August 2, 2017 04.37 PMWednesday, August 9, 2017 02.00 PMDATEDIFFERENCEINDAYS(firstdate, seconddate)7

Boolean Functions

Syntax

IF(statement, then, else)

Definition

Checks statement. If statement passes, operation then is executed, otherwise, operation else is executed.

Returns resulting value after execution of operation then or else.

Parameters
statementType: Boolean. Required.
thenRequired. The value to be assigned if statement passes.
elseRequired. The value to be assigned if statement fails.
Example
statementthenelseFormulaxResult
x < 1000y = 0y = x * 2IF(x < 1000, 0, x*2)12002400
x == truey = “blue”y = “red”IF(x, “blue”, “red”)true“blue”

Syntax

ISNULL(object)

Definition

Checks if object is null. If so, returns true; otherwise, returns false.

Parameters
objectRequired. Data to be checked if null or not.
Example
objectFormulaxResult
xISNULL(x)2017false
xISNULL(x.FIRST())[]true
Syntax

ISNOTNULL(object)

Definition

Checks if object is bound to any data. If so, returns true; otherwise, returns false.

Parameters
objectRequired. Data to be checked if null or not.
Example
objectFormulaxResult
xISNOTNULL(x)2017true
xISNOTNULL(x.FIRST())[]false

Syntax

NOT(statement)

Definition

Checks if statement resolves to false. If so, returns true; otherwise, returns false.

Parameters
statementRequired. Data to be checked if true or not.
Example
statementFormulaxResult
x.FIRST() > 1NOT(x.FIRST() > 1)[1,2,3]true
LENGTH(x) == 3NOT(LENGTH(x) == 3)[1,2,3]false
Syntax

EXACT(firstword, secondword)

Definition

Checks if the strings firstword and secondword are the same. If so, returns true. Otherwise, returns false.

Return Type: Boolean

Parameters
firstwordType: String. Required.
secondwordType: String. Required.
Example
firstwordsecondwordFormulaResult
“Welcome”“Welcome”EXACT(firstword,secondword)true
“Welcome” “welcome!”EXACT(firstword,secondword)false
Syntax

IN(item, list)

Definition

Checks if item is contained in list. Returns true or false.

Parameters
itemRequired. Element to be searched.
listList to be searched in.
Example
itemlistFormulaResult
Employee EEmployees: [E,F,G]IN(E, Employees)true
Employee AEmployees: [E,F,G]IN(A, Employees)false

List Functions

Syntax

datalist.FILTER(statement)

Definition

Filters the dataset datalist with respect to statement. No return value.

Parameters
datalistRequired. Dataset to be filtered.
statementType: Boolean. Required. Boolean expression to use for filtering.
Example
dataliststatementFormulaResult
[24,3,17,35]this > 20datalist.FILTER(statement)[24,35]
[24,3,17,35]this > 20 and this < 30datalist.FILTER(this > 20).FILTER(this < 30)[24]
Syntax

datalist.FIRST()

Definition

Returns the first element of a list.

Parameters
datalistRequired.
Example
datalistFormulaResult
[24,3,17,35]datalist.FIRST()[24]
[24,3,17,35]datalist.FILTER(this <  20).FIRST()[3]
Syntax

datalist.SORT(field, [statement])

Definition

Sorts datalist with respect to field, by using boolean expression statement.

Statement is an optional parameter.

On default, sorts in descending order.

Sorts in descending order if statement is true.

Sorts in ascending order if statement is false.

No return value.

Parameters
datalistRequired. Dataset to be sorted.
fieldRequired.datalist is sorted with respect to field.
statementType: Boolean. Optional. If true, sorts in descending order; otherwise sorts in ascending order. 
Example
datalistFormulaResult
[24,3,17,35]datalist.SORT(this)[35,24,17,3]
[24,3,17,35]datalist.SORT(this, true)[35,24,17,3]
[24,3,17,35]datalist.SORT(this, false)[3,17,24,35]
Syntax

TOSTRINGARRAY(datalist)

Definition

Converts elements of the list datalist to string, then returns a new list consisting of those strings.

Return Type: List of Strings

Parameters
datalistType: List. Required.
Example
datalistFormulaResult
[1,2,3,4]TOSTRINGARRAY(datalist)[“1”,”2”,”3”,”4”]

Syntax

datalist.TAKE(count)

Definition

Takes first “count” elements of datalist.

No return value.

Parameters
datalistRequired. Dataset to be operated on.
countRequired. Number of elements to take.
Example
datalistcountFormulaResult
[24,3,17,35]1datalist.TAKE(1)[24]
[24,3,17,35]3datalist.TAKE(3)[24,3,17]
Syntax

datalist.OFFSET(skipcount)

Definition

Skips the first “skipcount” elements of datalist, and then takes the remaining.

No return value.

Parameters
datalistRequired. Dataset to be operated on.
skipcountRequired. Number of elements to skip.
Example
datalistskipcountFormulaResult
[24,3,17,35]2datalist.OFFSET(2)[17,35]
[24,3,17,35]4datalist.OFFSET(4)[]
[24,3,17,35]1datalist.OFFSET(1).TAKE(2)[3,17]

Syntax

LENGTH(datalist)

Definition

Returns number of elements of the list datalist.

Parameters
datalistRequired. Dataset to be operated on.
Example
datalistFormulaResult
[24,3,17,35]LENGTH(datalist)4
[]LENGTH(datalist)0
Syntax

 ADDRANGE(firstlist, secondlist)

Definition

 Modifies firstlist to be the concatenation of firstlist and secondlist.

Parameters
firstlist Required. The list to be modified.
secondlist Required. The list to be added.
Example
firstlistsecondlistFormulaResult
 [“foo”, “bar”] [“qux”, “foo”] ADDRANGE(firstlist,secondlist)[“foo”, “bar”,”qux”, “foo”]
Syntax

CONCAT(firstlist, secondlist)

Definition

Returns a new list which is concatenation of firstlist and secondlist.

Return Type: List.

Parameters
firstlistRequired.
secondlistRequired.
Example
firstlistsecondlistFormulaResult
[“foo”, “bar”][“qux”, “foo”]CONCAT(firstlist, secondlist)[“foo”, “bar”, “qux”, “foo”]
Syntax

DISTINCT(datalist)

Definition

Returns a new list consisting of distinct elements from datalist.

Return Type: List

Parameters
datalistRequired.
Example
datalistFormulaResult
[“foo”, “bar”, “foo”, “qux”, “qux”]DISTINCT(firstlist) [“foo”, “bar”, “qux”]
Syntax

CONTAINS(datalist, element)

Definition

Checks if datalist contains element. If so, returns true, otherwise, returns false.

Return Type: Boolean

Parameters
datalistRequired. The list.
elementRequired. The element to be searched in datalist.
Example
datalistelementFormulaResult
[“foo”, “bar”, “foo”, “qux”]“bar”CONTAINS(datalist,”bar”)true
[“1”, “2”, “3”, “foo”]1CONTAINS(datalist,1)false
Syntax

COUNT(datalist)

Definition

Returns the number of elements contained in the list datalist.

Return Type: Integer

Parameters
datalistRequired.
Example
datalistFormulaResult
[“foo”, “bar”, “foo”, “qux”, “qux”]COUNT(firstlist)5

Syntax

PUSH(datalist, element)

Definition

Adds element to the end of datalist.

Parameters
datalistRequired. The list.
elementRequired. The element to be added to datalist.
Example
datalistelementFormulaResult
[“foo”, “bar”]“qux”PUSH(datalist,”qux”)[“foo”,“bar”,“qux”]

Syntax

UNION(firstlist, secondlist)

Definition

Returns a new list that is formed by merging firstlist and secondlist.

Parameters
firstlistRequired. First list to be merged.
secondlistRequired. Second list to be merged.
Example
firstlistsecondlistFormulaResult
[“foo”, “bar”, “baz”][“qux”, “foo”]UNION(firstlist, secondlist)[“foo”, “bar”, “baz”, “qux”]

Syntax

INTERSECT(firstlist, secondlist)

Definition

Returns a new list that is formed by taking intersection of firstlist and secondlist.

Parameters
firstlistRequired. First list to get intersect over.
secondlistRequired. Second list to get intersect over.
Example
firstlistsecondlistFormulaResult
[“foo”, “bar”, “baz”][“qux”, “foo”]INTERSECT(firstlist, secondlist)[“foo”]
Syntax

EXCEPT(firstlist, secondlist)

Definition

Returns a new list which consists of those elements that are in firstlist but not in secondlist.

Parameters
firstlistRequired. Minuend of the difference operation.
secondlistRequired. Subtrahend of the difference operation.
Example
firstlistsecondlistFormulaResult
[“foo”, “bar”, “baz”, “bar”][“qux”, “foo”]EXCEPT(firstlist, secondlist)[“bar”, “baz”, “bar”]

Syntax

MEAN(list)

Definition

Returns the average  of a list consisting of decimals.

Return Type: Decimal

Parameters
listType: List<Decimal>. Required.
Example
listFormulaResult
[5.5,10.5,8.2,6.8]]MEAN(list)7.75

Domain Entity Functions

Syntax

UISelect(initialselection, selectby, options)

Definition

Selects from among options, displayed as selectby list. It is initialized with initialselection.

Returns the selected item.

Parameters
initialselectionOptional. Initially selected object x.
selectbyRequired. Displayed field in options list
optionsRequired. Data to be listed.
Example
initialselectionselectbyoptionsFormulaResult
EmailEmployees [E,F,G]UISelect(Emloyee E, String Email, Employees)Employee F
Syntax

UIInput(input)

Definition

Creates a new record input. Returns input.

Parameters
input Type: Generic. Required. Data to be saved.
Example
FormulaResult
UIInput(Employee E)Employee E
Syntax

UIEdit(editvar)

Definition

Edits editvar, returns editvar.

Parameters
editvar Required. Data to edit.
Example
FormulaResult
UIEdit(Employee E)Employee E
Syntax

UIDisplay(displayvar)

Definition

Displays displayvar.

No return value.

Parameters
displayvarRequired. Data to display.
Example
FormulaResult
UIDisplay(Employee E)Employee E
Syntax

ROUTETO(userid)

Definition

Returns RoutingId for userid. RoutingId is then used to route the related workflow step to the user having userid.

Parameters
useridType: Guid. Required.
Example
useridFormulaResult
7682fd1f-629d-4d7f-a2f1-61e7553db94dROUTETO(userid)00aafc7c-506d-4872-b31e-3421ef85fd78
Syntax

ROUTETOLOGINNAME(loginname)

Definition

Returns RoutingId for loginname. RoutingId is then used to route the related workflow step to the user having loginname.

Parameters
loginnameType: String. Required.
Example
loginnameFormulaResult
“jane.doe@kuika.com”ROUTETOLOGINNAME(loginname)00aafc7c-506d-4872-b31e-3421ef85fd78

Syntax

ROUTETOMANY(userid_list)

Definition

Returns a list of RoutingIds for loginname. RoutingId list is then used to route the related workflow step to the users having ids in userid_list.

Parameters
userid_listType: Guid. Required.
Example
userid_listFormulaResult
[“jane.doe@kuika.com”, “john.doe@kuika.com

]

ROUTETOMANY(“jane.doe@kuika.com”, “john.doe@kuika.com)[00aafc7c-506d-4872-b31e-3421ef85fd78,

c16de123-1e36-426c-8cd5-4bfe8d243aae

Syntax

GetWorkflowInstanceReportsByDateInterval(appname, versionname, state, startdate, enddate)

Definition

Returns KuikaWorkflowInstanceReport list for dates between startdate-enddate, for version versionname of app appname for workflow instances in state state.

Parameters
appnameType: String. Required. Name of the app.
appversionnameType: String. Optional. Name of the app version.
stateType: String. Optional. Workflow instance state.
startdateType: String. Optional. Defines start limit to workflow instance creation date.
enddateType: String. Optional. Defines end limit to workflow instance creation date.
Example
appnameappversionnamestatestartdateenddate
“Test app”“Version 1”“RUNNING”“Tue Aug 01, 2017”“Fri Aug 18, 2017”

 

 

FormulaResult
GetWorkflowInstanceReportsByDateInterval

(“Test app”,

“Version 1”,

“RUNNING”,

“Tue Aug 01, 2017”,

“Fri Aug 18, 2017”)

[{ WorkflowInstanceId : d18da3f4-9466-4810-a700-de2cd26eb169,

AppName :

“Test app”,

AppVersionName :

”Version 1”,

AppVersionId : a030f065-b553-4671-b983-f496956d8b2f,

StarterKuikaIdentityId : 34d1fdb1-cfc8-4327-9950-3f45ff4c2340,

State : “RUNNING”,

CreatedAt : “Wed Aug 2, 2017”,

LastUpdateAt : “Thu Aug 3, 2017”

}]

Syntax

GETEMAILOFIDENTITY(userid)

Definition

Returns email of identity with id userid.

Return type: String.

Parameters
useridType: Guid. Required.
Example
useridFormulaResult
1a3f9249-5c14-45c5-a603-e0d20fd6f6bcGETEMAILOFIDENTITY(userid)“john.doe@kuika.com”
Syntax

GETPHONEOFIDENTITY(userid)

Definition

Returns phone number of identity with id userid.

Return type: String.

Parameters
useridType: Guid. Required.
Example
useridFormulaResult
1a3f9249-5c14-45c5-a603-e0d20fd6f6bcGETPHONEOFIDENTITY(userid)“05001234567”

Syntax

GETSTEPURL(stepname, workflowinstance_id)

Definition

Returns url of a workflow step with name stepname, of a workflow instance with id workflowinstance_id.

Return type: String.

Parameters
stepnameType: String. Required.
workflowinstance_idType: Guid. Required.
Example
stepnameworkflowinstance_idFormulaResult
“Test step”1a3f9249-5c14-45c5-a603-e0d20fd6f6bcGETSTEPURL(userid)“0500123456”
Syntax

NEWID()

Definition

Creates and returns a new domain entity.

Example
FormulaResult
A = NEWID()New domain entity A
Syntax

GETDOMAINENTITYIDS(userid, domainname)

Definition

Returns domain entity ids corresponding to user with userid in domain domainname.

Return Type: List of Guids

Parameters
useridType: Guid. Required. Id of a Kuika user.
domainnameType: String. Required. Name of a domain in Kuika.
Example
useriddomainnameFormulaResult
149893d2-9804-4832-8776-3e93aa69e03a“Kuika”GETDOMAINENTITYIDS(userid, domainname)[1044dc4b-f43c-4db0-9ace-2ada2a4dcec1,

fe83464e-d906-4bec-80f4-9f5cb0706762,

b9b58855-1477-470d-a522-7e5dc98c753c]

Syntax

DOLLAR(amount, numdecimal)

Definition

Returns a string with a dollar sign and the specified amount, taking numdecimal digits after comma.

Return Type: String

Parameters
amountType: Integer. Required.
numdecimalType: Integer. Required. Number of digits to take after comma.
Example
amountnumdecimalFormulaResult
1200DOLLAR(120,0)“$120”
144.3362DOLLAR(amouınt,numdecimal)“$144.33”
Syntax

STARTAPP(appname)

Definition

Returns the workflow instance id of the app to start. This method serves to start a workflow instance from within another workflow instance.

Return Type: Guid

Parameters
appnameType: String. Required. The name of an app to be started.
Example
appnameFormulaResult
“Test App”STARTAPP(“Test App”1e8d6b1c-fa78-44a1-85b8-a810fd960a6b

Syntax

NAVIGATEMAPTO(latitude, longitude)

No return value.

Definition

Opens a navigation application in your mobile phone and navigates to the location with coordinates latitude and longitude.

Parameters
latitudeType: Decimal. Required. Latitude of the desire location to navigate.
longitudeType: Decimal. Required. Longitude of the desire location to navigate.
Example
latitudelongitudeFormulaResult
44.09926.329NAVIGATEMAPTO(latitude,longitude)No return value.
Syntax

LOGOUT()

Definition

Logs out of the Shell client.

Example
FormulaResult
LOGOUT()Logs out of the Shell.
Syntax

ALERT(title, description, buttontext, alerttype)

Definition

Displays an alert button with the specified title, text, button, and type.

Example
FormulaResult
ALERT(“Success!”, “Your message has been sent successfully!”, “OK”, “success”)
Syntax

TRIGGEREVENT(eventname)

Definition

This function can be used to call and trigger an event.

Parameters
eventnameType: String. Required. Name of the event to be triggered.
Example
FormulaResult
TRIGGEREVENT(eventname)the event “eventname” is triggered and run.
Syntax

GETCURRENTLOCATION(latitude, longitude)

Definition

This function gets the current location coordinates, and then sets the parameters latitude and longitude to the current location values. For example you can use this function to displaying the current location on a map entity in your screen.