Functions library
Find documented Ninox functions fast in one A–Z reference. Use this page for quick lookup.
Use Work with functions to explore functions by category.
A
abs()
Return the absolute value of a number.
abs(number)
numberthe value to convert
Find more details here.
acos()
Return the arccosine of a value between -1 and 1.
acos(number)
numberthe cosine value
Find more details here.
age()
Return the number of full years since a date.
age(date)
datethe reference date
Find more details here.
alert()
Show a simple message with an OK button.
alert(any)
anythe message or value to show
Find more details here.
appendTempFile()
Add text to an existing temporary file.
appendTempFile(link, string) or
appendTempFile(string, string)
linkorstring(first argument) the temporary file linkstring(second argument) the content to append
Find more details here.
appointment()
Create an appointment from start and end, or from start and duration.
appointment(any, any)
anyfirst argument: start or end valueanysecond argument: end value or duration
Find more details here.
array()
Merge two arrays into one array.
array([any], [any])
[any]first array[any]second array
Find more details here.
asin()
Return the arcsine of a value between -1 and 1.
asin(number)
numberthe sine value
Find more details here.
atan()
Return the arctangent of a number.
atan(number)
numberthe value or quotient
Find more details here.
atan2()
Return the arctangent of one value divided by another.
atan2(number, number)
numberfirst argument: numeratornumbersecond argument: denominator
Find more details here.
avg()
Return the average of numeric values.
avg([number])
[number]an array or numeric field list
Find more details here.
C
capitalize()
Capitalize the first letter of each word.
capitalize(string)
stringthe text to convert
Find more details here.
ceil()
Round a number up to the next integer.
ceil(number)
numberthe value to round
Find more details here.
chosen()
Return selected values from a multiple choice field, or check whether a value is selected.
chosen(multi), chosen(multi, string), chosen(multi, number), chosen(multi, [number])
multia multiple choice fieldstringa label to checknumberan option ID[number]several option IDs
Find more details here.
clientLang()
Return the current client language code.
clientLang()
Find more details here.
closeAllRecords()
Close all open form views.
closeAllRecords()
Find more details here.
closeFullscreen()
Exit full screen mode and return to the previous view.
closeFullscreen()
Find more details here.
closeRecord()
Close the current record view.
closeRecord()
Find more details here.
cnt()
Count non-empty items in a list or selection. This is the short form of count.
cnt([any])
[any]the list or selection to count
Find more details here.
color()
Return a color value.
color(name), color(r, g, b), color(r, g, b, a), color(choice)
namea color name or hex coder, g, bRGB valuesaopacitychoicea choice field with colors
Find more details here.
concat()
Return one comma-separated text string.
concat([any]) or concat(value1, value2, ...)
[any]an array, selection, or multiple choice fieldvalue1, value2, ...values to combine
Find more details here.
contains()
Check whether text or a list contains an exact value.
contains(string, string) or contains([any], any)
stringthe text to search; second argument the value to find[any]the array to search; second argument the value to find
Find more details here.
cos()
Return the cosine of an angle in radians.
cos(number)
numberthe angle in radians
Find more details here.
count()
Count non-empty items in a list or selection.
count([any])
[any]the list or selection to count
Find more details here.
createTempFile()
Create a temporary file with initial content. createTempFile(string, string)
string(first argument) the initial contentstring(second argument) the filename
Find more details here.
createTextFile()
Create a plain text file.
createTextFile(nid, string, string), createTextFile(nid, string, string, any)
nidoptional target recordstringcontent and filenameanyoptional settings such as encoding
Find more details here.
createXLSX()
Create an Excel file from records or a workbook definition.
createXLSX(nid, any, string)
nidtarget recordanydata and workbook or worksheet definitionstringfilename
Find more details here.
createZipFile()
Bundle files into one ZIP archive.
createZipFile(nid, [file], string)
nidoptional target record[file]files to includestringZIP filename
Find more details here.
D
databaseId()
Return the ID of the current app (database).
databaseId()
Find more details here.
date()
Create a date, or strip the time part from a time-based value.
date(any) or date(year, month, day)
anya date, datetime, or Unix millisecondsyear,month,daythe date parts
Find more details here.
datetime()
Create a local timestamp.
datetime(milliseconds), datetime(year, month, day, hour, minute, second, millisecond), or datetime(date, time)
millisecondsUnix time in millisecondsdate and time parts that define the local timestamp
date,timeseparate date and time values
Find more details here.
day()
Return the day of the month.
day(date), day(timestamp), day(appointment)
datea date valuetimestampa timestamp or datetime valueappointmentan appointment value; Ninox uses the start date
Find more details here.
days()
Return the number of calendar days between two dates.
days(date, date)
first argument start date; second argument end date
Find more details here.
degrees()
Convert radians to degrees.
degrees(number)
numberthe angle in radians
Find more details here.
dialog()
Show a dialog and return the selected answer.
dialog(string, string, [string])
first argument title
second argument message
third argument answer options
Find more details here.
duplicate()
Create a copy of a record.
duplicate(nid)
nidthe record to copy
Find more details here.
duration()
Return a time span from an appointment or between two values.
duration(appointment) or duration(end, start)
appointmentthe appointment to measureend,startthe later and earlier values
Find more details here.
E
email()
Return an email value from another value.
email(any)
anythe value to convert
Find more details here.
endof()
Return the end of an appointment or a calendar period.
endof(appointment) or endof(date, period)
appointmentthe appointment valuedatethe reference dateperioda period such as"month"or"week"
Find more details here.
eval()
Execute text as a script.
eval(string, nid)
stringtext containing calculations or a Ninox scriptnidthe record to which the script applies
Find more details here.
even()
Check whether a number is even.
even(number)
numberthe value to test
Find more details here.
exp()
Return e raised to a power.
exp(number)
numberthe exponent
Find more details here.
extractx()
Extract the first regex match from text.
extractx(string, string), extractx(string, string, string), extractx(string, string, string, string)
first argument the source text
second argument the regex pattern
third argument optional flags
fourth argument optional capture expression such as
$1
Find more details here.
F
fieldId()
Return the internal ID of a field.
fieldId(field), fieldId(nid, string), fieldId(string, string)
fieldthe field itselfnida record from the tablestringfield name, or table name and field name
Find more details here.
file()
Return one file reference.
file(nid, string)
nidthe record with the attachmentstringthe exact filename
Find more details here.
fileMetadata()
Return metadata such as name, size, and modified date.
fileMetadata(nid, string)
nidthe record with the attachmentstringthe exact filename
Find more details here.
files()
Return several file references as an array.
files(nid)
nidthe record with the attachments
Find more details here.
fileUrl()
Return a download link for a file.
fileUrl(nid, string)
nidthe record with the attachmentstringthe exact filename
Find more details here.
first()
Return the first item from a list or selection.
first([any])
[any]the list or selection
Find more details here.
floor()
Round a number down to the next integer.
floor(number)
numberthe value to round
Find more details here.
format()
Convert numbers, dates, times, and appointments to text with a format pattern.
format(number, pattern), format(date, pattern[, language]), format(time, pattern), format(timestamp, pattern[, language]), format(appointment, pattern[, language])
first argument the value to format
patternthe format expressionlanguageoptional language code
Find more details here.
formatJSON()
Convert a JSON object to a JSON string.
formatJSON(JSON)
JSONthe object to convert
Find more details here.
formatXML()
Convert a JSON object to XML text.
formatXML(JSON) or formatXML(JSON, boolean)
JSONthe object to convertbooleanwhether to pretty-print the output
Find more details here.
G
get()
Read a field by name, or read a stored key-value entry.
get(nid, string) or get(string)
nidthe record to read fromstringthe field name, field ID, or storage key
Find more details here.
H
html()
Return a rich text value with HTML rendering.
html(any)
anythe value or HTML string to render
Find more details here.
http()
Send an HTTP request.
http(string, string), http(string, string, JSON), http(string, string, JSON, any), http(string, string, JSON, [file]), http(string, string, JSON, any, [file])
first argument HTTP method such as
"GET"or"POST"second argument target URL
JSONoptional headersanyoptional body[file]optional uploaded files
Find more details here.
I
icon()
Return an icon value.
icon(choice) or icon(string)
choicea choice field with an iconstringthe icon name
Find more details here.
index()
Return the position of the first match in text or an array.
index(text, search) or index([any], any)
first argument the text or array to search
second argument the value to find
Find more details here.
importFile()
Import a file into Ninox.
importFile(nid, string), importFile(nid, link), importFile(nid, string, string), importFile(nid, link, string)
anya file sourcenidthe target recordstringorlinkthe source URL or file linkfinal
stringoptional filename
Find more details here.
isAdminMode()
Check whether the client UI is in admin mode.
isAdminMode()
Find more details here.
item()
Return one item from a list or one value from a JSON object.
item([any], number), item(JSON, number), item(JSON, string)
[any]the list or selectionnumberzero-based position or numeric JSON keystringJSON key
Find more details here.
J
join()
Combine text values into one string with a custom separator.
join([string], string)
[string]the list of text valuesstringthe separator
Find more details here.
L
last()
Return the last item from a list or selection.
last([any])
[any]the list or selection
Find more details here.
length()
Count characters in text or items in a list.
length(string) or length([any])
stringthe text to count[any]the array to count
Find more details here.
ln()
Return the natural logarithm of a number.
ln(number)
numberthe input value
Find more details here.
loadFileAsBase64()
Return file content as a Base64 string.
loadFileAsBase64(file) or loadFileAsBase64(nid, string)
filea file object or file fieldnidthe record with the attachmentstringthe exact filename
Find more details here.
loadFileAsBase64URL()
Return file content as a Base64 data URL.
loadFileAsBase64URL(file) or loadFileAsBase64URL(nid, string)
filea file object or file fieldnidthe record with the attachmentstringthe exact filename
Find more details here.
location()
Create a location value from a title and coordinates.
location(string, number, number)
stringthe location titlesecond argument latitude
third argument longitude
Find more details here.
log()
Return a logarithm with base 10 or another base.
log(number) or log(number, number)
first argument the input value
second argument optional base
Find more details here.
lower()
Convert text to lowercase.
lower(string)
stringthe text to convert
Find more details here.
lpad()
Pad text on the left to a fixed length.
lpad(string, length, padding)
stringthe source textlengththe target lengthpaddingthe padding characters
Find more details here.
M
max()
Return the highest number or latest date-like value.
max([any])
[any]the comparable values
Find more details here.
min()
Return the lowest number or earliest date-like value.
min([any])
[any]the comparable values
Find more details here.
month()
Return the month number from 1 to 12.
month(date), month(timestamp), month(appointment)
datea date valuetimestampa timestamp or datetime valueappointmentan appointment value; Ninox uses the start date
Find more details here.
monthIndex()
Return the month number from a month name.
monthIndex(text)
textthe month name
Find more details here.
monthName()
Return a month name.
monthName(date), monthName(date, language), monthName(number), monthName(number, language)
dateornumberthe source monthlanguageoptional language code
Find more details here.
N
ninoxApp()
Return the current app or client context.
ninoxApp()
Find more details here.
now()
Return the current date and time.
now()
Find more details here.
number()
Convert a value to a number.
number(any)
anythe value to convert
Find more details here.
numbers()
Return selected IDs from a multiple choice field.
numbers(multi) or numbers(dmulti)
multia multiple choice fielddmultia dynamic multiple choice field
Find more details here.
O
odd()
Check whether a number is odd.
odd(number)
numberthe value to test
Find more details here.
openFullscreen()
Open a record in its form view in full screen.
openFullscreen(nid)
nidthe record to open
Find more details here.
openPage()
Open a page by name.
openPage(string)
stringpage label or internal name
Find more details here.
openPrintLayout()
Open a record in a print layout.
openPrintLayout(nid, string)
nidthe record to openstringthe print layout name
Find more details here.
openRecord()
Open a record in its table's form view.
openRecord(nid)
nidthe record to open
Find more details here.
openTable()
Open a table by name.
openTable(string), openTable(string, string)
first
stringtable name or internal namesecond
stringthe view to open
Find more details here.
openURL()
Open a website, map link, or app link.
openURL(string)
stringthe URL to open
Find more details here.
P
parseCSV()
Convert CSV text into rows and columns.
parseCSV(string, options)
stringthe CSV textoptionsoptional settings such asfirstLineIsHeader,separator, andtextQuote
Find more details here.
parseJSON()
Convert a JSON string to a JSON object.
parseJSON(string)
stringthe JSON text
Find more details here.
parseXML()
Convert an XML string to a JSON object.
parseXML(string)
stringthe XML text
Find more details here.
phone()
Return a phone value with a call action on supported clients.
phone(number), phone(string)
numbernumber value to be used as a phone numberstringtext value for phone numbers that start with+, include leading zeros, or contain spaces
Find more details here.
popupRecord()
Preview a record in a popup.
popupRecord(nid)
nidthe record to show
Find more details here.
pow()
Raise a number to a power.
pow(base, exponent)
basethe starting numberexponentthe power to apply
Find more details here.
printAndSaveRecord()
Generate a PDF, save it, and return a link.
printAndSaveRecord(nid, string)
nidthe record to printstringthe name of the print layout to be used
Find more details here.
printRecord()
Print one record with a given print layout.
printRecord(record, string)
recordthe record to printstringthe layout or template name
Find more details here.
printTable()
Print a table view.
printTable(string, string)
first argument table name
second argument view name
Find more details here.
Q
quarter()
Return the quarter number from 1 to 4.
quarter(date)
datea date value, or a timestamp or datetime value
Find more details here.
R
radians()
Convert degrees to radians.
radians(number)
numberthe angle in degrees
Find more details here.
random()
Return a random number between 0 and 1.
random()
Find more details here.
range()
Build an array of consecutive numbers.
range(to), range(from, to), range(from, to, step)
fromoptional start valuetostop valuestepoptional increment
Find more details here.
raw()
Return the internal raw text representation of a value.
raw(any)
anythe value to inspect
Find more details here.
record()
Return a record reference from a table and numeric record ID.
record(table, id)
tablethe table that contains the recordidthe numeric record ID
Find more details here.
removeFile()
Delete a file.
removeFile(file) or removeFile(nid, string)
filethe file object to removenidthe record with the attachmentstringthe exact filename
Find more details here.
removeItem()
Remove one key-value pair from a JSON object.
removeItem(JSON, string)
JSONthe object to changestringthe key to remove
Find more details here.
renameFile()
Rename a file.
renameFile(file, string) or renameFile(nid, string, string)
filethe file object to renamenidthe record with the attachmentstringcurrent and new filenames
Find more details here.
replace()
Replace each exact match of one string with another.
replace(text, search, replacement)
textthe source textsearchthe text to findreplacementthe text to insert
Find more details here.
replacex()
Replace text with a regular expression.
replacex(text, pattern, replacement) or replacex(text, pattern, flags, replacement)
textthe source textpatternthe regex patternflagsoptional regex flagsreplacementthe replacement text
Find more details here.
round()
Round a number to an integer or decimal place.
round(number) or round(number, digits)
numberthe value to rounddigitsoptional number of decimal places
Find more details here.
rpad()
Pad text on the right to a fixed length.
rpad(string, length, padding)
stringthe source textlengththe target lengthpaddingthe padding characters
Find more details here.
rsort()
Sort values in descending order.
rsort([any]), rsort(any, any, ...), rsort([any], [any], ...)
arguments: values or arrays of the same type
Find more details here.
S
set()
Update a field by name or field ID.
set(nid, string, any)
nidthe record to updatestringthe field name or field IDanythe new value
Find more details here.
setItem()
Add or update one key-value pair in a JSON object.
setItem(JSON, string, any)
JSONthe object to changestringthe key to updateanythe new value
Find more details here.
shareFile()
Create a share link for a file.
shareFile(file) or shareFile(nid, string)
filethe file object to sharenidthe record to which the file is attachedstringthe exact filename
Find more details here.
shareView()
Create a share link for a saved view.
shareView(string), shareView(string, string), shareView(string, JSON), shareView(string, string, JSON)
first
stringthe table namesecond
stringthe optional view nameJSONoptional share settings for the shared type
Find more details here.
sign()
Return whether a number is negative or non-negative.
sign(number)
numberthe value to check
Find more details here.
sin()
Return the sine of an angle.
sin(number)
numberthe angle value
Find more details here.
sleep()
Pause a script for a number of milliseconds.
sleep(number)
numberthe delay in milliseconds
Find more details here.
slice()
Return part of a list or part of a string.
slice([any], from, to) or slice(string, from, to)
first argument the list or text to slice
frominclusive start positiontoexclusive end position
Find more details here.
sort()
Sort values in ascending order.
sort([any]), sort(any, any, ...), sort([any], [any], ...)
arguments: values or arrays of the same type
Find more details here.
split()
Split text into parts at each exact separator.
split(text, separator)
textthe source textseparatorthe split marker
Find more details here.
splitx()
Split text into parts with a regex pattern.
splitx(text, pattern)
textthe source textpatternthe regex split pattern
Find more details here.
sqr()
Square a number.
sqr(number)
numberthe value to square
Find more details here.
sqrt()
Return the square root of a number.
sqrt(number)
numberthe input value
Find more details here.
start()
Return the start timestamp of an appointment.
start(appointment)
appointmentthe appointment value
Find more details here.
string()
Convert a value to its raw string form.
string(value)
valuethe value to convert
Find more details here.
styled()
Return styled text with optional colors and an icon.
styled(text, background), styled(text, background, icon), styled(text, background, fontColor, icon), styled(text, JSON)
textthe text to showbackgroundbackground colorfontColortext coloriconicon nameJSONstyle definition
Find more details here.
substr()
Return part of a string from a start position.
substr(text, start) or substr(text, start, length)
textthe source textstartzero-based start positionlengthoptional number of characters
Find more details here.
substring()
Return part of a string between two positions.
substring(text, start, end)
textthe source textstartzero-based start positionendexclusive end position
Find more details here.
sum()
Add numeric values together.
sum([number])
[number]an array or numeric field list
Find more details here.
T
tableId()
Return the internal ID of a table.
tableId(table), tableId(nid), tableId(string)
tablethe table itselfnida record from the tablestringthe table name
Find more details here.
tan()
Return the tangent of an angle.
tan(number)
numberthe angle value
Find more details here.
teamId()
Return the ID of the current workspace.
teamId()
Find more details here.
testx()
Check whether text matches a regular expression.
testx(string, string) or testx(string, string, string)
first argument the source text
second argument the regex pattern
third argument optional flags
Find more details here.
text()
Convert a value to readable text.
text(value)
valuethe value to convert
Find more details here.
time()
Return the current time, extract a time, or create a time value.
time(), time(any), time(hour, minute), time(hour, minute, second), time(hour, minute, second, millisecond)
anya time-based value or Unix millisecondstime parts: hour, minute, second, and millisecond
Find more details here.
timeinterval()
Create a duration offset.
timeinterval(any) or timeinterval(number, unit)
anya time-related value or millisecondsnumberthe amountunita unit such as"hours"or"days"
Find more details here.
timestamp()
Convert a time-related value to a UTC-based timestamp.
timestamp(any)
anya date-like value or Unix milliseconds
Find more details here.
today()
Return the current date without a time part.
today()
Find more details here.
trim()
Remove spaces at the start and end of a string.
trim(string)
stringthe text to clean
Find more details here.
U
unique()
Remove duplicate values from one or more arrays.
unique([any]) or unique([any], [any], ...)
[any]the arrays to combine and deduplicate
Find more details here.
unshareAllViews()
Remove sharing from all saved views of a table.
unshareAllViews(string)
stringthe table name
Find more details here.
unshareFile()
Stop sharing a file.
unshareFile(file), unshareFile(nid, string)
filethe shared file objectnidthe record to which the file is attachedstringthe file name
Find more details here.
unshareView()
Stop sharing one saved view.
unshareView(string, string)
first
stringthe table namesecond
stringthe view name
Find more details here.
upper()
Convert text to uppercase.
upper(string)
stringthe text to convert
Find more details here.
url()
Return a link value from text or query data.
url(any) or url(any, JSON)
anythe source valueJSONoptional query parameters
Find more details here.
urlDecode()
Decode URL-encoded text.
urlDecode(string)
stringthe encoded text
Find more details here.
urlEncode()
Encode text for safe use in a URL.
urlEncode(string)
stringthe text to encode
Find more details here.
urlOf()
Return the URL of a table view, optionally with a record's form view open.
urlOf(nid), urlOf(nid, string), or urlOf(string, string)
nidthe record ID of the record to show in the form viewstringas the first argument, the table's label or internal namestringas the second argument, the view name
Find more details here.
user()
Return the current user, or look up a workspace user by name.
user() or user(string)
stringthe user name to look up
Find more details here.
userEmail()
Return the current user’s email, or another user’s email.
userEmail() or userEmail(user)
useroptional user value
Find more details here.
userFirstName()
Return the first name of the current or given user.
userFirstName() or userFirstName(user)
useroptional user value
Find more details here.
userFullName()
Return the full name of the current or given user.
userFullName() or userFullName(user)
useroptional user value
Find more details here.
userHasRole()
Check whether a user has a role.
userHasRole(string) or userHasRole(user, string)
stringthe role nameuseroptional user value to check
Find more details here.
userId()
Return the internal ID of the current or given user.
userId() or userId(user)
useroptional user value