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!”

Syntax

STRINCLUDES(fullString, stringToSearch)

Definition
Parameters
fullstringType: String. Required.
stringToSearchType: String. Required.
Syntax

STRINGTOGUID(string)

Definition
Parameters
stringType: String. Required.
Syntax

STRINGTODATE(anyString)

Definition

Parses the given string to a date object.

Parameters
anyStringType: String. Required.
Syntax

TOINTEGER(anyString)

Definition

Casts the given string to an integer.

Parameters
anyStringType: String. Required.
Syntax

STRREPLACE(fullString, stringToBeReplaced, newString)

Definition
Parameters
fullStringType: String. Required.
stringToBeReplacedType: String. Required.
newStringType: String. Required.
Syntax

SUBSTRING(str, start, end)

Definition
Parameters
srtType: String. Required.
startType: Integer. Required.
endType: Integer. Required.
Syntax

TOLOCALDATESTRING(date)

Definition
Parameters
dateType: Datetime. Required.
Syntax

TONUMERICSTRING(object, numberOfDecimalPlaces)

Definition
Parameters
objectType: Unbound. Required.
numberOfDecimalPlacesType: Integer. Optional.
Syntax

TOTITLECASE(str)

Definition

Makes the first letter of each word capitalized.

Parameters
strType: String. Required.
Syntax

TOUPPER(str)

Definition

Makes all characters upper case in a string.

Parameters
strType: String. Required.
Syntax

TRIMRIGHT(string, string)

Definition
Parameters
strType: String. Required.
strType: String. Required.
Syntax

UPPER(word)

Definition

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

Parameters
wordType: String. Required.
Syntax

VALIDATEEMAIL(email)

Definition

Returns true if given value is a valid email address.

Parameters
emailType: String. Required.
Syntax

VALIDATEPHONENUMBER (phoneNumber, prefix, numberLength)

Definition

Ensure the given text is converted to a phonenumber with given prefix and number of digits specified. +90 prefix and 10 digits are default.

Parameters
phoneNumberType: String. Required.
prefixType: String. Optional.
numberLengthType: Integer. Optional.

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
Syntax

ADDDAYS(date, numberOfDays)

Definition
Parameters
dateType: Integer. Required.
numberofDaysType: DateTimeOffset. Required.
Syntax

ADDYEARSDT(date, years)

Definition
Parameters
dateType: DateTime. Required.
yearsType: Integer. Required.
Syntax

ADDYEARSDTO(date, years)

Definition
Parameters
dateType: DateTimeOffset. Required.
yearsType: Integer. Required.
Syntax

DAY(dateTime)

Definition

Returns the day value of the date.

Parameters
datetimeType: Date Time Offset. Required.
Syntax

ISWEEKDAY(date)

Definition
Parameters
dateType: Date Time Offset. Required.
Syntax

MONTH(DateTime dt)

Definition

Returns the month index of given date.

Parameters
datetimeType: Date Time. Required.
Syntax

NEWDATE(year, month, day)

Definition

Returns a new date object with given values.

Parameters
yearType: Integer. Required.
monthType: Integer. Required.
dayType: Integer. Required.
Syntax

REMOVEYEARSDT(date, years)

Definition
Parameters
dateType: Datetime. Required.
yearsType: Integer. Required.
Syntax

SETTOLASTMIDNIGHT(dateTimeOffset)

Definition
Parameters
dateTimeOffsettType: Datetime. Required.
Syntax

YEAR(dateTime)

Definition

Returns the year of a given date.

Parameters
dateTimeType: Datetime. Required.

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

Syntax

AGGREGATE(stringArray, stringSeparator)

Definition
Parameters
stringArrayType: String. Required.
stringSeparatorType: String. Required.
Syntax

FIRSTOFARRAY(Any[] list)

Definition

Returns the first element of an array.

Parameters
anyArrayType: Unbound, Array. Required.
Syntax

list.GROUP(field)

Definition

Groups result set per given field.

Parameters
fieldType: Unbound. Required.
Syntax

TOARRAY(singleItem)

Definition
Parameters
singleItemType: Unbound. Required.

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.

Syntax

GETCURRENTLOCATION2(Geolocation geolocation)

Definition

Sets the Geolocation argument value to current geolocation of current user.

Parameters
geolocationType: Geolocation. Required.

Math Functions

Syntax

ABS(list)

Definition
Parameters
listRequired.
Example

 

listFormulaResult
Syntax

MAX(Int Item1, Int Item2, …)

Definition

Returns the maximum value from the given integers.

Parameters
IntegerType:Integer. Required.
IntegerType:Integer. Required.
Type:Integer. Optional.
Syntax

MIN(Int Item1, Int Item2, …)

Definition

Returns the minimum value from the given integers.

Parameters
IntegerType:Integer. Required.
IntegerType:Integer. Required.
Type:Integer. Optional.
Syntax

list.SUM(field, [statement])

Definition

Returns the sum of all the values of given field. i.e. #People.SUM(this.Age).

Parameters
fieldType:Unbound. Required.

File Functions

Syntax

ATTACHFILE(fileData, fileName, size, format)

Definition

Reads a file and its data to input parameter variables.

Parameters
fileDataType: String. Required.
fileNameType: String. Required.
sizeType: Integer. Required.
formatType: String. Required.
Syntax

ATTACHFILEURL(url, fileName, size, format)

Definition

Takes a file, uploads and returns a url.

Parameters
urlType: String. Required.
fileNameType: String. Required.
sizeType: Integer. Required.
formatType: String. Required.
Syntax

ATTACHFILEURLS(url, fileName, size, format)

Definition

Takes files, uploads and returns urls.

Parameters
urlType: String. Required.
fileNameType: String. Required.
sizeType: Integer. Required.
formatType: String. Required.
Syntax

DOWNLOADFILE(fileDataVar, fileNameVar, formatVar, successMsg, errorMsg)

Definition

Downloads the file with input parameter variables to the device from given data.

Parameters
fileDataType: String. Required.
fileNameType: String. Required.
formatType: String. Required.
successMsgType: String. Optional.
errorMsgType: String. Optional.
Syntax

DOWNLOADFILEURL(fileUrlVar, fileNameVar, formatVar, successMsg, errorMsg)

Definition

Downloads the file with input parameter variables to the device from a given url.

Parameters
fileUrlType: String. Required.
fileNameType: String. Required.
formatType: String. Required.
successMsgType: String. Optional.
errorMsgType: String. Optional.

Event Functions

Syntax

BROADCAST(anyName)

Definition

Broadcast an event name in the scope of all your app, up to you to listen to it with ONBROADCAST.

Parameters
anyNameType: String. Required.
Syntax

BROADCASTINFINITESCROLLCOMPLETE()

Definition

If you let pull down refresh in a page, you need to call this to close the pull down refresh visual.

Parameters
Syntax

ONBROADCAST(anyName, eventName)

Definition

Listen to any broadcast you made with BROADCAST, and trigger any given event you specify here when broadcast is heard.

Parameters
anyNameType:String. Required.
eventNameType:String. Required.
Syntax

SCROLLTOP()

Definition

Scrolls to the top of the page.

Parameters
 –
Syntax

TRIGGEREVENTPERIODICALLY(eventName, milliseconds)

Definition

Triggers the event with given name periodically for every given milliseconds.

Parameters
eventNameType: String. Required
millisecondsType: Integer. Required
Syntax

SETTIMEOUT(anyFunction, milliseconds)

Definition

Calls the given function after given milliseconds.

Parameters
anyFunctionType: String. Required
millisecondsType: Integer. Required

Authorization Functions

Syntax

SENDRESETPASSWORDMAIL(username)

Definition

Send a password reset mail to given username.

Parameters
usernameType: String. Required.
Syntax

SIGNIN(username, password, isSuccessful, errorMessage)

Definition

Signs in with given credentials, automatically redirects to opening page.end a password reset mail to given username.

Parameters
usernameType: String. Required.
passwordType: String. Required.
isSuccessfulType: Boolean. Optional.
errorMessageType: String. Optional.
Syntax

SIGNUP(username, password, isSuccessful, errorMessage, optionalFirstname, optionalLastname)

Definition

Signs up with given credentials.

Parameters
usernameType: String. Required.
passwordType: String. Required.
isSuccessfulType: Boolean. Optional.
errorMessageType: String. Optional.
optionalFirstnameType: String. Optional.
optionalLastnameType: String. Optional.

User Functions

Syntax

GETCURRENTGEOLOCATIONOF(username)

Definition

Returns the current geolocation of a user with given username.

Parameters
usernameType: String. Required.
Syntax

GETMYEMAIL()

Definition

Returns the email address of the current user.

Parameters
Syntax

GETMYNAME()

Definition

Returns the name of the current user.

Parameters
Syntax

GETMYNAMESURNAME()

Definition

Returns the name and surname in a single text for current user.

Parameters
Syntax

GETMYPHONENUMBER()

Definition

Returns phonenumber of current user.

Parameters
Syntax

GETMYUSERNAME()

Definition

Returns the username of current user.

Parameters
Syntax

HASROLE(domainName, roleName)

Definition
Parameters

 

domainNameType: String. Required.
roleNameType: String. Required.

Data Functions

Syntax

GETCURRENTGEOLOCATIONOF(username)

Definition

Returns the current geolocation of a user with given username.

Parameters
usernameType: String. Required.
Syntax

READFROMCONTEXT(key)

Definition
Parameters
key Type: String. Required.
Syntax

READFROMLOCALSTORAGE(key)

Definition

Reads the given key’s value from local storage.

Parameters
key Type: String. Required.
Syntax

SERVERDELETE(Any entity)

Definition

Deletes the record(s) from the database.

Parameters
entity Type: Guid. Required.
Syntax

WRITETOCONTEXT(key, value)

Definition

Saves your data with your given name in a session context.

Parameters
key Type: String. Required.
value Type: String. Required.
Syntax

WRITETOLOCALSTORAGE(key, value)

Definition

Saves your data with your given name in the local storage.

Parameters
key Type: String. Required.
value Type: String. Required.
Syntax

RANDOM(anyList)

Definition

returns a random value from the given list.

Parameters
anyListType: Unbound. Required.

Native Functions

Syntax

CALLPHONENUMBER(String phonenumber)

Definition

Makes a phone call to the given phonenumber.

Parameters
phoneNumberType: String. Required.
Syntax

IsDevicePaired(isDevicePairedResultBoolean)

Definition
Parameters
booleanType: Boolean. Required.
Syntax

OPENAPP(appName)

Definition
Parameters
appNameType: String. Required.
Syntax

OPENEMAILCLIENT(email, subject, body)

Definition

Opens default email client of mobile device.

Parameters
emailType: String. Required.
subjectType: String. Optional.
bodyType: String. Optional.
Syntax

OPENLINKINBROWSER(url)

Definition
Parameters
url Type: String. Required.
Syntax

OPENLINKINSYSTEMBROWSER(url)

Definition
Parameters
url Type: String. Required.
Syntax

SCANBARCODE(barcode)

Definition

Opens camera, scans barcode and write the found value to the input parameter variable.

Parameters
barcodeType: String. Required.
Syntax

SOCIALSHARE(message, messageTitle, UrlToShare)

Definition
Parameters
messageType: String. Required.
messageTitleType: String. Required.
urlToShareType: String. Required.
Syntax

TAKEPHOTO(imageData, format, size, fileName, maxWidth)

Definition

Takes a photo. Parameters are outputs, filled by the function when photo is taken. If maxWidth is given, photo is resized accordingly.

Parameters
imageDataType: String. Required.
formatType: String. Required.
sizeType: Integer. Required.
fileNameType: String. Required.
maxWidthType: Integer. Optional.
Syntax

TAKEPHOTOURL(urlVar, format, size, fileName, maxWidth)

Definition

Takes a photo. Parameters are outputs, filled by the function when photo is taken. If maxWidth is given, photo is resized accordingly.

Parameters
urlVarType: String. Required.
formatType: String. Required.
sizeType: Integer. Required.
fileNameType: String. Required.
maxWidthType: Integer. Optional.

Geolocation/Maps Functions

Syntax

GEOCODE(address, latitude, longitude)

Definition

Uses google maps api and converts the given ‘address’ to latitue and longitude and sets the values of given arguments.

Parameters
addressType: String. Required.
latitudeType: Decimal. Required.
longitudeType: Decimal. Required.
Syntax

GETCURRENTGEOLOCATIONOF(username)

Definition

Returns the current geolocation of a user with given username.

Parameters
usernameType: String. Required.
Syntax

REVERSEGEOCODE(latitude, longitude, address)

Definition

Uses google maps api and converts the given latitude and longitude to an address.

Parameters
latitudeType: Decimal. Required.
longitudeType: Decimal. Required.
addressType: String. Required.
Syntax

STARTGEOLOCATIONTRACKING()

Definition

Starts saving current geolocation of current user every 5 seconds to the server.

Parameters
–       
Syntax

STOPGEOLOCATIONTRACKING()

Definition

Stops the geolocation tracking.

Parameters
–       

Image Functions

Syntax

GETPHOTOFROMGALLERY(imageData, format, size, fileName, sizeLimit, maxWidth)

Definition

Gets a photo from gallery. Given variables filled with data. if sizeLimit or maxWidth is given, image is resized.

Parameters
imageDataType: String. Required.
formatType: String. Required.
sizeType: Integer. Required.
fileNameType: String. Required.
sizeLimitType: Integer. Optional.
maxWidthType: Integer. Optional.
Syntax

GETPHOTOURLFROMGALLERY(urlVar, format, size, fileName, sizeLimit, maxWidth)

Definition

Gets a photo from gallery. Given variables filled with file info and url. if sizeLimit or maxWidth is given, image is resized.

Parameters
urlVarType: String. Required.
formatType: String. Required.
sizeType: Integer. Required.
fileNameType: String. Required.
sizeLimitType: Integer. Optional.
maxWidthType: Integer. Optional.
Syntax

GETPHOTOURLFROMGALLERY(urlVar, format, size, fileName, sizeLimit, maxWidth)

Definition

Gets a photo from gallery. Given variables filled with file info and url, if sizeLimit or maxWidth is given, image is resized.

Parameters
urlVarType: String. Required.
formatType: String. Required.
sizeType: Integer. Required.
fileNameType: String. Required.
sizeLimitType: Integer. Optional.
maxWidthType: Integer. Optional.

Reporting Functions

Syntax

GetKAppLogInstancesByBundleId(bundleid)

Definition

Returns App Log records for a given app bundle id. i.e. GetAppLogInstances(\”com.k.someapp.id\”)

Parameters
bundleidType: String. Required.
Syntax

GetCompletedInstancesReportOfApp(appName)

Definition

Returns completed workflow instance reports for app with given name.

Parameters
appNameType: String. Required.
Syntax

GetRunningInstancesReportOfApp(appName)

Definition

Returns running workflow instance reports for app with given name.

Parameters
appNameType: String. Required.
Syntax

GetWorkflowStepInstanceReports(workflowInstanceId)

Definition

Returns workflow step instance records for a given workflow instance id.

Parameters
workflowInstanceIdType: Guid. Required.

Push Notification Functions

Syntax

SENDPUSHNOTIFICATIONTOUSERNAMES(usernames, message, appBundleId)

Definition
Parameters
usernamesType: String. Required.
messageType: String. Required.
appBundleIdType: String. Optional.
Syntax

SENDPUSHNOTIFICATIONSTOUSERNAMESWITHSEMICOLONS(usernames, message, appBundleId, keysOfExtraData, valuesOfExtraData)

Definition
Parameters
usernamesType: String. Required.
messageType: String. Required.
appBundleIdType: String. Required.
keysOfExtraDataType: String. Optional.
valuesOfExtraDataType: String. Optional.
Syntax

SENDPUSHNOTIFICATIONTOAPP(appBundleId, message, keysOfExtraData, valuesoOfExtraData)

Definition
Parameters
appBundleIdType: String. Required.
messageType: String. Required.
keysOfExtraDataType: String. Optional.
valuesOfExtraDataType: String. Optional.
Syntax

SENDPUSHNOTIFICATIONTOUSERNAME(username, message, appBundleId, keysOfExtraData, valuesoOfExtraData)

Definition
Parameters
usernameType: String. Required.
messageType: String. Required.
appBundleIdType: String. Optional.
keysOfExtraDataType: String. Optional.
valuesOfExtraDataType: String. Optional.

Misc. Functions

Syntax

CANCELTIMER(timername)

Definition

Cancel an on-going timer event before it’s over.

Parameters
timernameType: String. Required.
Syntax

TIMER(timername, durationinseconds, ontimeoutevent, notifyoncyclesevent)

Definition

Trigger an event (notifyoncycleevent) for every second until given duration of seconds is over when a timeout event is triggered. Name it with a timername, to later cancel.

Parameters
timernameType: String. Required.
durationinsecondsType: Integer. Required.
ontimeouteventType: String. Required.
notifyoncycleseventType: String. Required.
Syntax

DONOTHING()

Definition

It does nothing. Handy when one case of IF is supposed to do nothing.

Parameters
Syntax

HIDELOADINGSPINNER()

Definition

Hides the Ionic spinner if it was opened by calling SHOWLOADINGSPINNER()

Parameters
Syntax

KUIKASEARCHONCLIENTSIDE(all)

Definition

Please contact for detailed instructions.

Parameters
please contact for detailsplease contact for details
Syntax

NAVIGATEINMAINVIEW(screenName)

Definition

Navigates the main screen holder to given screen, keeps no history. Best to use for navigation buttons in left menu or tabs.

Parameters
screenNameType: String. Required.
Syntax

NOTIFY(message, alertType)

Definition

Creates a self-disappearing popup message at the bottom of the screen. ‘success’, ‘error’ are alerttypes, success is default.

Parameters
messageType: String. Required.
alertTypeType: String. Optional.
Syntax

SEARCHCLIENTSIDE(all)

Definition

Please contact for detailed instructions.

Parameters
Syntax

SENDPAGETOPRINTER()

Definition

Prints current page.

Parameters
Syntax

SHOWLOADINGSPINNER()

Definition

Show Ionic default spinner, locks the full screen.

Parameters
Syntax

TOGGLELEFTMENU()

Definition

Opens or closes left menu.

Parameters
Syntax

TYPEOF(variableToCheck)

Definition

Returns the type of an object on client side.

Parameters
variableToCheckType:Unbound. Required
Syntax

VALUEIFNULL(prm1, defaultValue)

Definition

If value is null, returns given default value. Handy to clean null values in arrays.

Parameters
prm1Type:Integer. Required
defaultValueType:Integer. Required