For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Jump to: A · C · D · E · F · G · H · I · J · L · M · N · O · P · Q · R · S · T · U · V · W · Y

A

abs()

Return the absolute value of a number. abs(number)

  • number the value to convert

Find more details here.


acos()

Return the arccosine of a value between -1 and 1. acos(number)

  • number the cosine value

Find more details here.


age()

Return the number of full years since a date. age(date)

  • date the reference date

Find more details here.


alert()

Show a simple message with an OK button. alert(any)

  • any the message or value to show

Find more details here.


appendTempFile()

Add text to an existing temporary file. appendTempFile(link, string) or appendTempFile(string, string)

  • link or string (first argument) the temporary file link

  • string (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)

  • any first argument: start or end value

  • any second 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)

  • number the sine value

Find more details here.


atan()

Return the arctangent of a number. atan(number)

  • number the value or quotient

Find more details here.


atan2()

Return the arctangent of one value divided by another. atan2(number, number)

  • number first argument: numerator

  • number second 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)

  • string the text to convert

Find more details here.


ceil()

Round a number up to the next integer. ceil(number)

  • number the 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])

  • multi a multiple choice field

  • string a label to check

  • number an 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)

  • name a color name or hex code

  • r, g, b RGB values

  • a opacity

  • choice a 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 field

  • value1, 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)

  • string the 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)

  • number the 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 content

  • string (second argument) the filename

Find more details here.


createTextFile()

Create a plain text file. createTextFile(nid, string, string), createTextFile(nid, string, string, any)

  • nid optional target record

  • string content and filename

  • any optional settings such as encoding

Find more details here.


createXLSX()

Create an Excel file from records or a workbook definition. createXLSX(nid, any, string)

  • nid target record

  • any data and workbook or worksheet definition

  • string filename

Find more details here.


createZipFile()

Bundle files into one ZIP archive. createZipFile(nid, [file], string)

  • nid optional target record

  • [file] files to include

  • string ZIP 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)

  • any a date, datetime, or Unix milliseconds

  • year, month, day the 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)

  • milliseconds Unix time in milliseconds

  • date and time parts that define the local timestamp

  • date, time separate date and time values

Find more details here.


day()

Return the day of the month. day(date), day(timestamp), day(appointment)

  • date a date value

  • timestamp a timestamp or datetime value

  • appointment an 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)

  • number the 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)

  • nid the 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)

  • appointment the appointment to measure

  • end, start the later and earlier values

Find more details here.


E

email()

Return an email value from another value. email(any)

  • any the value to convert

Find more details here.


endof()

Return the end of an appointment or a calendar period. endof(appointment) or endof(date, period)

  • appointment the appointment value

  • date the reference date

  • period a period such as "month" or "week"

Find more details here.


eval()

Execute text as a script.

eval(string, nid)

  • string text containing calculations or a Ninox script

  • nid the record to which the script applies

Find more details here.


even()

Check whether a number is even. even(number)

  • number the value to test

Find more details here.


exp()

Return e raised to a power. exp(number)

  • number the 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)

  • field the field itself

  • nid a record from the table

  • string field name, or table name and field name

Find more details here.


file()

Return one file reference. file(nid, string)

  • nid the record with the attachment

  • string the exact filename

Find more details here.


fileMetadata()

Return metadata such as name, size, and modified date.

fileMetadata(nid, string)

  • nid the record with the attachment

  • string the exact filename

Find more details here.


files()

Return several file references as an array. files(nid)

  • nid the record with the attachments

Find more details here.


fileUrl()

Return a download link for a file. fileUrl(nid, string)

  • nid the record with the attachment

  • string the 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)

  • number the 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

  • pattern the format expression

  • language optional language code

Find more details here.


formatJSON()

Convert a JSON object to a JSON string. formatJSON(JSON)

  • JSON the object to convert

Find more details here.


formatXML()

Convert a JSON object to XML text. formatXML(JSON) or formatXML(JSON, boolean)

  • JSON the object to convert

  • boolean whether 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)

  • nid the record to read from

  • string the field name, field ID, or storage key

Find more details here.


H

html()

Return a rich text value with HTML rendering. html(any)

  • any the 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

  • JSON optional headers

  • any optional body

  • [file] optional uploaded files

Find more details here.


I

icon()

Return an icon value. icon(choice) or icon(string)

  • choice a choice field with an icon

  • string the 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)

  • any a file source

  • nid the target record

  • string or link the source URL or file link

  • final string optional 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 selection

  • number zero-based position or numeric JSON key

  • string JSON 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 values

  • string the 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])

  • string the text to count

  • [any] the array to count

Find more details here.


ln()

Return the natural logarithm of a number. ln(number)

  • number the input value

Find more details here.


loadFileAsBase64()

Return file content as a Base64 string. loadFileAsBase64(file) or loadFileAsBase64(nid, string)

  • file a file object or file field

  • nid the record with the attachment

  • string the exact filename

Find more details here.


loadFileAsBase64URL()

Return file content as a Base64 data URL. loadFileAsBase64URL(file) or loadFileAsBase64URL(nid, string)

  • file a file object or file field

  • nid the record with the attachment

  • string the exact filename

Find more details here.


location()

Create a location value from a title and coordinates. location(string, number, number)

  • string the location title

  • second 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)

  • string the text to convert

Find more details here.


lpad()

Pad text on the left to a fixed length. lpad(string, length, padding)

  • string the source text

  • length the target length

  • padding the 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)

  • date a date value

  • timestamp a timestamp or datetime value

  • appointment an appointment value; Ninox uses the start date

Find more details here.


monthIndex()

Return the month number from a month name. monthIndex(text)

  • text the month name

Find more details here.


monthName()

Return a month name. monthName(date), monthName(date, language), monthName(number), monthName(number, language)

  • date or number the source month

  • language optional 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)

  • any the value to convert

Find more details here.


numbers()

Return selected IDs from a multiple choice field. numbers(multi) or numbers(dmulti)

  • multi a multiple choice field

  • dmulti a dynamic multiple choice field

Find more details here.


O

odd()

Check whether a number is odd. odd(number)

  • number the value to test

Find more details here.


openFullscreen()

Open a record in its form view in full screen. openFullscreen(nid)

  • nid the record to open

Find more details here.


openPage()

Open a page by name. openPage(string)

  • string page label or internal name

Find more details here.


openPrintLayout()

Open a record in a print layout. openPrintLayout(nid, string)

  • nid the record to open

  • string the print layout name

Find more details here.


openRecord()

Open a record in its table's form view. openRecord(nid)

  • nid the record to open

Find more details here.


openTable()

Open a table by name. openTable(string), openTable(string, string)

  • first string table name or internal name

  • second string the view to open

Find more details here.


openURL()

Open a website, map link, or app link. openURL(string)

  • string the URL to open

Find more details here.


P

parseCSV()

Convert CSV text into rows and columns. parseCSV(string, options)

  • string the CSV text

  • options optional settings such as firstLineIsHeader, separator, and textQuote

Find more details here.


parseJSON()

Convert a JSON string to a JSON object. parseJSON(string)

  • string the JSON text

Find more details here.


parseXML()

Convert an XML string to a JSON object. parseXML(string)

  • string the XML text

Find more details here.


phone()

Return a phone value with a call action on supported clients. phone(number), phone(string)

  • number number value to be used as a phone number

  • string text 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)

  • nid the record to show

Find more details here.


pow()

Raise a number to a power. pow(base, exponent)

  • base the starting number

  • exponent the power to apply

Find more details here.


printAndSaveRecord()

Generate a PDF, save it, and return a link. printAndSaveRecord(nid, string)

  • nid the record to print

  • string the name of the print layout to be used

Find more details here.


printRecord()

Print one record with a given print layout. printRecord(record, string)

  • record the record to print

  • string the 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)

  • date a date value, or a timestamp or datetime value

Find more details here.


R

radians()

Convert degrees to radians. radians(number)

  • number the 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)

  • from optional start value

  • to stop value

  • step optional increment

Find more details here.


raw()

Return the internal raw text representation of a value. raw(any)

  • any the value to inspect

Find more details here.


record()

Return a record reference from a table and numeric record ID. record(table, id)

  • table the table that contains the record

  • id the numeric record ID

Find more details here.


removeFile()

Delete a file. removeFile(file) or removeFile(nid, string)

  • file the file object to remove

  • nid the record with the attachment

  • string the exact filename

Find more details here.


removeItem()

Remove one key-value pair from a JSON object. removeItem(JSON, string)

  • JSON the object to change

  • string the key to remove

Find more details here.


renameFile()

Rename a file. renameFile(file, string) or renameFile(nid, string, string)

  • file the file object to rename

  • nid the record with the attachment

  • string current and new filenames

Find more details here.


replace()

Replace each exact match of one string with another. replace(text, search, replacement)

  • text the source text

  • search the text to find

  • replacement the text to insert

Find more details here.


replacex()

Replace text with a regular expression. replacex(text, pattern, replacement) or replacex(text, pattern, flags, replacement)

  • text the source text

  • pattern the regex pattern

  • flags optional regex flags

  • replacement the replacement text

Find more details here.


round()

Round a number to an integer or decimal place. round(number) or round(number, digits)

  • number the value to round

  • digits optional number of decimal places

Find more details here.


rpad()

Pad text on the right to a fixed length. rpad(string, length, padding)

  • string the source text

  • length the target length

  • padding the 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)

  • nid the record to update

  • string the field name or field ID

  • any the new value

Find more details here.


setItem()

Add or update one key-value pair in a JSON object. setItem(JSON, string, any)

  • JSON the object to change

  • string the key to update

  • any the new value

Find more details here.


shareFile()

Create a share link for a file. shareFile(file) or shareFile(nid, string)

  • file the file object to share

  • nid the record to which the file is attached

  • string the 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 string the table name

  • second string the optional view name

  • JSON optional share settings for the shared type

Find more details here.


sign()

Return whether a number is negative or non-negative. sign(number)

  • number the value to check

Find more details here.


sin()

Return the sine of an angle. sin(number)

  • number the angle value

Find more details here.


sleep()

Pause a script for a number of milliseconds. sleep(number)

  • number the 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

  • from inclusive start position

  • to exclusive 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)

  • text the source text

  • separator the split marker

Find more details here.


splitx()

Split text into parts with a regex pattern. splitx(text, pattern)

  • text the source text

  • pattern the regex split pattern

Find more details here.


sqr()

Square a number. sqr(number)

  • number the value to square

Find more details here.


sqrt()

Return the square root of a number. sqrt(number)

  • number the input value

Find more details here.


start()

Return the start timestamp of an appointment. start(appointment)

  • appointment the appointment value

Find more details here.


string()

Convert a value to its raw string form. string(value)

  • value the 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)

  • text the text to show

  • background background color

  • fontColor text color

  • icon icon name

  • JSON style definition

Find more details here.


substr()

Return part of a string from a start position. substr(text, start) or substr(text, start, length)

  • text the source text

  • start zero-based start position

  • length optional number of characters

Find more details here.


substring()

Return part of a string between two positions. substring(text, start, end)

  • text the source text

  • start zero-based start position

  • end exclusive 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)

  • table the table itself

  • nid a record from the table

  • string the table name

Find more details here.


tan()

Return the tangent of an angle. tan(number)

  • number the 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)

  • value the 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)

  • any a time-based value or Unix milliseconds

  • time parts: hour, minute, second, and millisecond

Find more details here.


timeinterval()

Create a duration offset. timeinterval(any) or timeinterval(number, unit)

  • any a time-related value or milliseconds

  • number the amount

  • unit a unit such as "hours" or "days"

Find more details here.


timestamp()

Convert a time-related value to a UTC-based timestamp. timestamp(any)

  • any a 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)

  • string the 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)

  • string the table name

Find more details here.


unshareFile()

Stop sharing a file. unshareFile(file), unshareFile(nid, string)

  • file the shared file object

  • nid the record to which the file is attached

  • string the file name

Find more details here.


unshareView()

Stop sharing one saved view. unshareView(string, string)

  • first string the table name

  • second string the view name

Find more details here.


upper()

Convert text to uppercase. upper(string)

  • string the text to convert

Find more details here.


url()

Return a link value from text or query data. url(any) or url(any, JSON)

  • any the source value

  • JSON optional query parameters

Find more details here.


urlDecode()

Decode URL-encoded text. urlDecode(string)

  • string the encoded text

Find more details here.


urlEncode()

Encode text for safe use in a URL. urlEncode(string)

  • string the 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)

  • nid the record ID of the record to show in the form view

  • string as the first argument, the table's label or internal name

  • string as 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)

  • string the 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)

  • user optional user value

Find more details here.


userFirstName()

Return the first name of the current or given user. userFirstName() or userFirstName(user)

  • user optional user value

Find more details here.


userFullName()

Return the full name of the current or given user. userFullName() or userFullName(user)

  • user optional user value

Find more details here.


userHasRole()

Check whether a user has a role. userHasRole(string) or userHasRole(user, string)

  • string the role name

  • user optional user value to check

Find more details here.


userId()

Return the internal ID of the current or given user. userId() or userId(user)

  • user optional user value