Work with functions

Learn how to use Ninox functions by category, and find the right tools for calculations, text, dates, records, and more.

Functions are the building blocks of Ninox logic. They help you calculate values, format text, work with dates, filter records, and more.

If you are new to functions, start with the parameter syntax below. Once you can read entries like text(any) or count([any]), the rest of the reference becomes much easier to use.

Understand function parameters

Function entries show what a function expects. Read them from left to right:

  • the function name tells you what it does

  • the part in parentheses shows the expected input

This helps you see quickly whether a function fits your task.

For example:

  • odd(number) expects a number

  • text(any) can convert many value types to readable text

  • count([any]) expects a list, array, or selection

What any means

any means the function can work with different value types. Ninox converts or interprets the value inside the function. For example, text(any) can turn a number, date, choice, or other value into text.

This is more flexible than a function like odd(number), which expects a number.

any does not mean every value is equally useful. Pass a value that makes sense for the function you are using.

What [any] means

[any] means the function expects a list of values. If you are new to scripting, read square brackets as “a list of.”

This is usually:

  • an array

  • a record selection

  • a list of field values

For example:

  • count([any]) counts items in a list or selection

  • first([any]) returns the first item

  • concat([any]) joins values into text

The items in that list can be different types, depending on the function.

When a function returns any

If a function returns any, the result can vary. For example, one function can return:

  • text in one case

  • a number in another

  • a record or JSON value in another

Check the function description and example to see what result to expect.

If you are just getting started, focus on the input first. The examples usually make the result clear.

When a function expects JSON

Some functions need several related values at once. JSON is a compact way to group them together.

Each entry has a name on the left and a value on the right. In the documentation, this is labeled as JSON.

You write them with curly braces:

In this example:

  • from is the sender address

  • to is the recipient address

  • subject is the email subject

  • text is the message body

Use this pattern when a function needs several named values such as to, subject, or text.

Common examples are:

  • sendEmail(JSON)

  • http(..., JSON)

  • printRecord(..., JSON)

JSON here means a value you pass directly, for example {to: "[email protected]"}. It does not mean quoted text like "{\"to\":\"[email protected]\"}".

Other parameter labels you will see

Some labels show a type. Others show the role of the value.

For example, number, date, and record are type labels. Labels like pattern, separator, from, and to show how that argument is used in the function.

Read both together:

  • the label tells you the kind of value

  • the description tells you how that value is used

Parameter glossary

This section covers the parameter labels used across the function chapters below.

Label
Meaning

any

Any value type that the function can interpret or convert

[any]

A list of values

appointment

One value that contains a start and end together

background

A background color or style value

base

The base number in a logarithm or power expression

boolean

true or false

choice

A value from a single choice field

date

A date value without a time

datetime

A local date and time value

year, month, day

Numeric date parts

dmulti

A dynamic multiple choice field

exponent

The power applied to a base number

field

A field object

file

One file object or attachment reference

[file]

A list of file objects

flags

Optional regular expression options

fontColor

A text color value

hour, minute, second, millisecond

Numeric time parts

icon

An icon name or icon value

id

A numeric ID

JSON

A structured object with named values

language

A language code for localized output

length

A target length or number of characters

link

A link value, often a file link

location

A location value with coordinates

milliseconds

Unix time in milliseconds

multi

A multiple choice field

name

A name, for example for a color

nid

A Ninox record ID

number

A numeric value

[number]

A list of numeric values

options

A settings object for one specific function

padding

The characters used to pad text

pattern

A format pattern or regular expression

period

A calendar unit such as "day", "week", or "month"

r, g, b, a

Red, green, blue, and optional opacity values

record

One record from a table

[record]

A list or selection of records

replacement

The value that replaces a match

script

An expression or logic block that Ninox evaluates

search

The value or text to look for

start, end

Starting and ending values or positions

separator

A text separator or split marker

step

The increment in a numeric range

string

Plain text, such as a name, label, URL, or field name

[string]

A list of text values

table

A table object

text

Text input; usually the source text in string functions

time

A time-of-day value

timestamp

A UTC-based time value

from, to

Start and end values or positions

unit

A duration unit such as "minutes" or "days"

user

A workspace user value

value, value1, value2, ...

Generic input values passed singly or separately

Quick reading tips

  • plain labels like number or record show the expected type

  • square brackets like [number] or [file] mean “a list of”

  • labels like pattern, separator, from, or subject describe the argument’s role

Explore functions by category

Once the syntax feels familiar, use these categories to find the right function faster:

If you need the full reference, go to the Functions library. It gives you a complete overview of documented functions in one place, including an alphabetical list for quick lookup.

Last updated

Was this helpful?