Ninox Manual
Search…
Functions overview
​

abs

​

abs(number)

abs(x) To return the absolute value of a number x.
number
​More >​

acos

​

acos(number)

acos(x) To calculate the arccosine of a number x.
number
​More > ​

age

​

age(date)

To return the number of full years between now and a given date (e.g. a person’s age).
number
​More > ​

alert

​

alert(any)

alert(anyMessage) To open a pop-up message box with an "Ok" button. If multiple alerts are included in the script only the last one will be executed.
void

appointment

​

appointment(any, any)

appointment(start, end) or appointment(start, duration) To convert 2 given time-related values to an appointment.
appointment
​More >​

array

​

array([any], [any])

To create a new array by merging 2 arrays of a similar type.
[any]
​More > ​

asin

​

asin(number)

asin(x) To calculate the arcsine of a number x.
number
​More >​

atan

​

atan(number)

atan(x) To calculate the arctangent of a number x.
number
​More >​

atan2

​

atan2(number, number)

atan2(x, y) To calculate the arctangent of the quotient of x/y.
number
​More >

avg

​

avg([number])

To return the average value of a number array.
number
​More >​

barcodeScan

​

barcodeScan()

To open the barcode scanner (mobile/tablet) and return the scanned value as a string.
string

capitalize

​

capitalize(string)

To capitalize the first letter of each word.
string
​More > ​

ceil

​

ceil(number)

To round up a given number to the nearest integer.
number
​More >​

chosen

​

chosen(multi, [number])

To return "true" (Yes) if the given numbers representing the choice value IDs are fully covered in the selection.
boolean

chosen(multi, number)

To return "true" (Yes) if the given number equals the ID of one of the selected choice values.
boolean

chosen(multi, string)

To return "true" (Yes) if a given string equals at least one of the selected choice values.
boolean

chosen(multi)

To get all chosen values from a multiple-choice field.
[string]
​More >​

clientLang

​

clientLang()

To return the currently used language of the browser or app in abbreviated form.
string
​More > ​

closeAllRecords

​

closeAllRecords()

To close all record forms.
void

closeFullscreen

​

closeFullscreen()

To close full-screen mode.
void

closeRecord

​

closeRecord()

To close the top record form.
void

color

​

color(choice)

To return the color of a choice value.
color

color(number, number, number)

color(red, green, blue) To return a color value from RGB components.
color

color(number, number, number, number)

color(red, green, blue, alpha) To return a color value from RGB- and alpha- components.
color

color(string)

To convert a text to a color value.
color

concat

​

concat([any])

To return all items of an array in one string.
string
​More >​

contains

​

contains(string, string)

contains(string, match) To check if a given string contains the exact given match.
boolean
​More > ​

cos

​

cos(number)

cos(x) To calculate the cosine of a number x.
number
​More > ​

count / cnt

​

count([any]) / cnt([any])

To return the number of items in an array or a selection of records.
number

createCalendarEvent

​

createCalendarEvent(string, appointment)

createCalendarEvent(title, appointment) To create an event in the Apple Calendar App with a given title.
void
createCalendarEvent(string, string, appointment)
createCalendarEvent(calendar, title, appointment) To create an event in the Apple Calendar App in a given calendar with a given title.
void

createCalendarEvent(string, timestamp, timestamp)

createCalendarEvent(title, from, to) To create an event in the Apple Calendar App with a given title and a given start and end.
void

createCalendarEvent(string, string, timestamp, timestamp)

createCalendarEvent(calendar, title, from, to) To create an event in the Apple Calendar App with a given title and a given start and end.
void
​More >​

createCalendarReminder

​

createCalendarReminder(string)

createCalendarReminder(title) To create a reminder in the Apple Calendar App with a given title.
void

createCalendarReminder(string, timestamp)

createCalendarReminder(title, start) To create a reminder in the Apple Calendar App with a given title and a given start.
void

createCalendarReminder(string, timestamp, timestamp)

createCalendarReminder(title, from, to) To create a reminder in the Apple Calendar App with a given title and a given start and end.
void

createCalendarReminder(string, string, timestamp, timestamp)

createCalendarReminder(calendar, title, from, to) To create a reminder in the Apple Calendar App in a given calendar with a given title and a given start and end.
void
​More > ​

createTextFile

​

createTextFile(nid, string, string)

createTextFile(record, content, fileName) To create a text file with a given name and content.
file
​More >

databaseId

​

databaseId()

To return the ID of the current database.
string

date

​

date(number, number, number)

date(year, month, day) To return a date value.
date

date(any)

To convert a given time-related value to a date value. If the value is a number, it represents the Unix time in milliseconds.
date
​More >​

datetime

​

datetime(date, time)

To convert a given date and time to a timestamp.
timestamp

datetime(number)

To convert a given number to a timestamp where the number represents the Unix time in milliseconds.
timestamp

datetime(number, number, number)

datetime(year, month, day) To return a timestamp out of the given year, month, and day numbers.
timestamp

datetime(number, number, number, number)

datetime(year, month, day, hour) To return a timestamp out of the given year, month, day, and hour numbers.
timestamp

datetime(number, number, number, number, number)

datetime(year, month, day, hour, minute) To return a timestamp out of the given year, month, day, hour, and minute numbers.
timestamp

datetime(number, number, number, number, number, number)

datetime(year, month, day, hour, minute, second) To return a timestamp out of the given year, month, day, hour, minute, and second numbers.
timestamp

datetime(number, number, number, number, number, number, number)

datetime(year, month, day, hour, minute, second, millis) To return a timestamp out of the given year, month, day, hour, minute, second, and millisecond numbers.
timestamp
​More >​

day

​

day(date)

To return the day of the month of a given date.
number

day(appointment)

To return the day of a given start of an appointment.
number

day(timestamp)

To return the day of the month of a given timestamp.
number
​More >​

days

​

days(date, date)

days(start, end) To return the number of days between 2 given dates.
number
​More > ​

degrees

​

degrees(number)

degrees(x) To convert angle x from radians to degrees.
number
​More > ​

dialog

​

dialog(string, string, [string])

dialog(title, message, answerOptions) To pop up a dialog with answer options.
string

duration

​

duration(appointment)

To return the duration of a given appointment.
timeinterval
​More >

duplicate

​

duplicate(nid)

duplicate(record) To create a duplicate of a given record.
nid

email

​

email(any)

To convert a given value to an email value.
email
​More >​

endof

​

endof(appointment)

To return the end timestamp of a given appointment.
timestamp
​More > ​

even

​

even(number)

To return "true" if the number is even.
boolean
​More >

exp

​

exp(number)

exp(x) To calculate the power to the base e (e is the Euler's number) with a number x as an exponent.
number
​More >

extractx

​

extractx(string, string)

extractx(myText, regex) To extract a string from a given text using a regular expression.
string

extractx(string, string, string)

extractx(myText, regex, extract) To extract a string from a given text using a regular expression. The string can be further processed with given extract.
string

extractx(string, string, string, string)

extractx(myText, regex, flags, extract) To extract a string from a given text using a regular expression. Flags can be added to the regular expression. The string can be further processed with a given extract.
string
​More >​

​

​

file

​

file(nid, string)

file(record, fileName) To return a specific file based on the file name from a given record.
file
​More >​

fileMetadata

​

fileMetadata(nid, string)

fileMetadata(record, fileName) To return the metadata, like file name, size, and modification date of a file based on a given record and file name.
JSON

files

​

files(nid)

To return all attachments of a record as an array.
[file]

first

​

first([any])

To return the first item of an array.
any

floor

​

floor(number)

To round down a given number to the nearest integer.
number
​More > ​

format

​

format(appointment, string)

format(appointment, formatExpression) To format a given start of an appointment as a string.
string

format(appointment, string, string)

format(appointment, formatExpression, language) To format a given start of an appointment as a string, where the result shows in a specific language supported by Ninox.
string

format(date,string)

format(date, formatExpression) To format a given date as a string.
string

format(date, string, string)

format(date, formatExpression, language) To format a given date as a string, where the result shows in a specific language supported by Ninox.
string

format(number, string)

format(number, formatExpression) to format a given number as a string.
string

format(time, string)

format(time, formatExpression) To format a given time as a string.
string

format(timestamp,string)

format(datetime, formatExpression) To format a given timestamp as a string.
string

format(timestamp, string, string)

format(datetime,formatExpression,language) To format a given timestamp as a string, where the result shows in a specific language supported by Ninox.
string
​More >​

formatJSON

​

formatJSON(JSON)

To create a JSON string of a valid JSON object.
string

formatXML

​

formatXML(JSON, boolean)

formatXML(json, pretty) To convert a given JSON object into XML text. If "pretty" is "true", the text is optically structured.
string

formatXML(JSON)

To convert a given JSON object into XML text
string

html

​

html(any)

html(value) To return a rich text representation of any value.
html
​More >​

http

​

http(string,string, JSON, JSON)

http(method, url, header, body) To call REST services - "method" and "url" are strings (header and body are optional objects).
JSON

icon

​

icon(choice)

To return the icon of a choice value.
icon

icon(string)

icon(iconName) To return an icon.
icon

importFile

​
importFile(record, link, fileName) To import a file from a given URL and save it as an attachment of a record.
file
importFile(nid, string, string)
importFile(record, link, fileName) To import a file from a given URL string and save it as an attachment of a record.
file
To import a file from a given URL and save it as an attachment of a given record.
file

importFile(nid, string)

To import a file from an URL string and save it as an attachment of a record.
file

index

​

index(string, string)

index(string, match) To return the first position of appearance of a match in the string starting with 0. If "match" is an empty string the result is 0, also. If "match" is not matching with the given string the result is -1.
number
​More >

isAdminMode

​

isAdminMode()

To return "true" if the edit mode is on.
boolean
​More > ​

isDatabaseLocked

isDatabaseLocked()

To return "Yes" if the database is locked
boolean
​More > ​

isDatabaseProtected

​

isDatabaseProtected()

To return "Yes" if a password is needed to activate the edit mode
boolean
​More > ​

item

​

item([any], number)

item(array, index) To extract a single item of an array, where the index is zero-based.
any

item(JSON, number)

item(json, key) To extract the value of a key-value pair of a given JSON object. The key needs to be a number.
any

item(JSON,string)

item(json,key) To extract the value of a key-value pair of a given JSON object.
any

join

​

join([string], string)

join(stringArray, separator) To return a string consisting of all items of a given string array separated by a given separator. The separator can be a line break.
string
​More >

last

​

last([any])

To return the last item of an array.
any

latitude

​

latitude(location)

To specify the latitude value of a given location field.
number

length

​

length(string)

To return the length of a given string as a character count.
number
​More >​

ln

​

ln(number)

ln(x) To calculate the natural logarithm of x.
number
​More >

location

​

location(string, number, number)

location(title, latitude, longitude) To return a location value with a given title, latitude, and longitude.
location

log

​

log(number, number)

log(x, y) To calculate the logarithm of x to the base of y.
number

log(number)

log(x) To calculate the logarithm of x to the base of 10.
number
​More >​

longitude

​

longitude(location)

To return the longitude of a given location.
number

lower

​

lower(string)

To output a string in lower case.
string
​More >

lpad

​

lpad(string, number, string)

lpad(string, length, padding) To fill up a given length with given padding at the beginning if the given text is shorter than the given length.
string
​More > ​

max

​

max([number])

To return the highest number of a number array.
number

max([timestamp])

To return the latest date of a date array.
timestamp

min

​

min([number])

To return the lowest number of a number array.
number

min([timestamp])

To return the earliest date of a date array.
timestamp

month

​

month(appointment)

To return the month of the start date of a given appointment as a number with January = 1, February = 2, … December = 12.
number

month(date)

To return the month of a given date as a number with January = 1, February = 2, … December = 12.
number

month(timestamp)

month(datetime) To return the month of a given timestamp as a number with January = 1, February = 2, … December = 12.
number
​More >​

monthIndex

​

monthIndex(string)

monthIndex(monthName) To return a given month as a number with January = 1, February = 2, … December = 12.
number
​More >​

monthName

​

monthName(date)

To return the full month name of a given date with 1 = January, 2 = February, … 12 = December.
string

monthName(date,string)

monthName(date,language) To return the full month name of a given date in a specific language supported by Ninox.
string

monthName(number)

To return the full month name of a given number with 1 = January, 2 = February, … 12 = December.
string

monthName(number,string)

monthName(number,language) To return the full month name of a given number in a specific language supported by Ninox.
string
​More > ​

ninoxApp

​

ninoxApp()

To return the type of platform that is currently being used
string
​Mehr > ​

now

​

now()

To return the current timestamp
timestamp
​More > ​

number

​

number(any)

To convert a given value to a number.
number
​More > ​

numbers

​

numbers(multi)

To return the internal IDs of the selected choice values of a given multiple choice field.
[number]

numbers(dmulti)

To return the record IDs of the selected choice values of a given dynamic multiple choice field.
[number]

odd

​

odd(number)

To return "true" if the number is odd.
boolean
​More >​

openFullscreen

​

openFullscreen(nid, any)

openFullscreen(nid, options) To open a given record in full-screen mode with options.
void

openFullscreen(nid, string)

openFullscreen(record, tabName) To open a given record in full-screen mode in a given tab.
void

openFullscreen(nid)

To open a given record in full-screen mode.
void

openPrintLayout

​

openPrintLayout(nid, string)

openPrintLayout(record,layoutName) To open a given record in a given layout in the print layout editor.
void

openRecord

​

openRecord(nid,string)

openRecord(record,tabName) To jump to the related table and open a given tab of a given record.
void

openRecord(nid)

To jump to the related table and open a given record.
void

openTable

​

openTable(string,string)

openTable(tableName, viewName) To open a given table with a given view.
void

openTable(string)

openTable(tableName) To open a given table.
void

openURL

​

openURL(string)

openURL(link) To convert a string to a link and open it in the standard web browser.
void

parseJSON

​

parseJSON(string)

To convert a JSON string to a JSON object. An invalid string will return an undefined value.
any

parseXML

​

parseXML(string)

parseXML(xml) To convert an XML string to a JSON object. An invalid string will return a parse error.
any

phone

​

phone(number)

To convert a number to a phone value.
phone

phone(string)

To convert a string to a phone value.
phone

popupRecord

​

popupRecord(nid,string)

popupRecord(nid,tabName) To open a record with a given tab in a pop-up form.
void

popupRecord(nid)

To open a record in a pop-up form.
void

pow

​

pow(number,number)

pow(x,y) To calculate the power of a base x using the exponent y.
number
​More >

printAndSaveRecord

​

printAndSaveRecord(nid, string)

printAndSaveRecord(record, layoutName) To save a given record in a given layout as PDF in the internal file system and return the path as a link.
link

printRecord

​

printRecord(nid, string)

printRecord(record, layoutName) To print to a PDF from a given record in a given layout and open the file with a program set as default.
void

printTable

​

printTable(string, string)

printTable(tableName, viewName) To print the visible columns of a given view to a PDF with a given table name and open the file with a program set as default.
void

quarter

​

quarter(date)

To return the quarter of a given date as a number with 1st quarter = 1, … 4th quarter = 4.
string
​More >​

radians

​

radians(number)

radians(x) To convert an angle x from degrees to radians.
number
​More > ​

random

​

random()

To return a random number between 0 (inclusive) and 1 (exclusive).
number
​More >​

range

​

range(number,number,number)

range(from,to,step) To return an array of consecutive numbers from a range between "from" and "to" by a given step, where "from" is included and "to" is excluded. If "from" is higher than "to" the numbers will appear in reverse order.
number

range(number,number)

range(from,to) To return an array of consecutive numbers from a range between "from" and "to", where "from" is included and "to" is excluded. If "from" is higher than "to" the numbers will appear in reverse order.
number

range(number)

range(to) To return an array of consecutive numbers starting with 0 up or down to "to", where "to" is excluded.
number

raw

​

raw(any)

To return the internal raw text representation of a given value.
string
​More >​

record

​

record(table, number)

record(myTable,id) To return a record of a given table by ID.

replace

​

replace(string, string, string)

replace(string, pattern, replace) To replace a pattern in a string with a given replace.
string
​More > ​

replacex

​

replacex(string, string, string)

replacex(text, regex, replace) To replace the matches of a given regular expression with "replace" in a given text.
string

replacex(string, string, string, string)

replacex(text, regex, flags, replace) To replace the matches of a given regular expression with "replace" in a given text. Flags can be added to the regular expression.
string
​More > ​

round

​

round(number,number)

round(number,digits) To round a given number with the given number of digits.
number

round(number)

To round a given number to the nearest integer.
number
​More >​

rpad

​

rpad(string,number,string)

lpad(string,length,padding) To fill the missing space of the given padding at the end, if the length of a given string is shorter than a given length.
string
​More > ​

rsort

​

rsort([any])

To sort an array in descending order.
[any]

sendEmail

​

sendEmail(JSON)

sendEmail(emailObject) To send an email out of Ninox where the email object consists of the following key-value pair:
1
({ from: "[email protected]",
5
subject: "Hello World!",
6
text: "Some text",
7
html: "Some text with markup",
8
attachments: files })
Copied!
"cc", "bcc", "subject" and "attachments" are optional.
any

shareFile

​

shareFile(nid, string)

shareFile(record, filename) To return an URL of a specific file, i.e. image, document, or a signature field.
link

shareFile(file)

shareFile(myFile) To return an URL of a specific file.
link

shareView

​

shareView(string)

shareView(tableName) To return an URL of the default view of the table for sharing.
link

shareView(string, string)

shareView(tableName, viewName) To return an URL of a given view of a given table for sharing.
link

shareView(string, JSON)

shareView(tableName, fileType) To return an URL of the default view of a given table in a given format (PDF, HTML, CSV, XLSX, or JSON) passed as a JSON object for sharing.
link

shareView(string, string, JSON)

shareView(tableName, viewName, fileType) To return an URL of a given view of a given table in a given format (PDF, HTML, CSV, XLSX, or JSON) passed as a JSON object for sharing
link

sign

​

sign(number)

sign(x) To return the signum of number x.
number
​More > ​

sin

​

sin(number)

sin(x) To calculate the sine of a number x.
number
​More > ​

sleep

​

sleep(number)

sleep(duration) To force Ninox to wait for a given number of milliseconds before running the code.
void

slice

​

slice([any],number,number)

slice(array, start, end) To extract a sub-array. Start and end are zero-based.
[any]

slice(string,number,number)

slice(text, start, end) To extract a text piece. Start and end are zero-based.
string
​More >

sort

​

sort([any])

To sort an array in ascending order.
[any]

split

​

split(string, string)

split(string, separator) To split a string into an array at each separator. The separator is not included in the array elements.
[string]
​More >

splitx

​

splitx(string, string)

splitx(string, regex) To split a string into an array by using a regular expression. The matches are not included in the array elements.
[string]

sqr

​

sqr(number)

sqr(x) To calculate the square of a number x.
number
​More > ​

sqrt

​

sqrt(number)

sqrt(x) To calculate the square root of a number x.
number
​More > ​

start

​

start(appointment)

To return the start timestamp of a given appointment.
timestamp
​More > ​

string

​

string(any)

To convert a given value to a string.
string
​More > ​

styled

​

styled(string, JSON)

styled(text, JSON) To convert a given string to a styled object with a JSON that consists of the following key-value pairs:
1
{
2
color: "myColor",
3
background: "myColor2",
4
icon: "iconName"
5
}
Copied!
styled

styled(string, string)

styled(text, backgroundColor) To convert a given string to a styled object with given background color as text.
styled

styled(string, color)

styled(text,backgroundColor) To convert a given string to a styled object with a given background color.
styled

styled(string, string, string)

styled(text, backgroundColor, icon) To convert a given string to a styled object with a given background color and icon as text.
styled

styled(string, color, icon)

styled(text, backgroundColor, icon) To convert a given string to a styled object with a given background color and icon.
styled

styled(string, string, string, string)

styled(text, backgroundColor, fontColor, icon) To convert a given string to a styled object with a given background, font color, and icon as text.
styled

styled(string, color, color, icon)

styled(text,backgroundColor,fontColor,icon) To convert a given string to a styled object with a given background color, font color, and icon.
styled
​More >​

substr

​

substr(string, number)

substr(text, start) To return a new string out of a given text with a given start. The start is zero-based.
string

substr(string, number, number)

substr(text, start, length) To return a new string out of a given text with a given start and a given end. The start is zero-based.
string
​More > ​

substring

​

substring(string, number, number)

substring(text, start, end) To return a new string out of a given text with a given start and a given end. The start is zero-based.
string
​More >

sum

​

sum([number])

To return the total sum of a number array.
number
​More > ​

tableId

​

tableId(nid)

To return the ID of a table by a given ID of a record.
string

tableId(string)

tableId(tableName) To return the ID of a table by a given name of a table.
string

tan

​

tan(number)

tan(x) To calculate the tangent of a number x.
number

teamId

​

teamId()

To return the ID of the current team.
string

testx

​

testx(string, string, string)

testx(myText, regex, flags) To return "true" if a given text matches a given regular expression. Flags can be added to the regular expression.
boolean

testx(string, string)

testx(myText, regex) To return "true" if a given text matches a given regular expression.
boolean