Data types and operators
Find common Ninox data types, operators, and conversion helpers fast.
Data types define what a script value is. Operators define what you do with that value.
Do not confuse data fields with data types. A data field is something you add in Builder mode, such as Text, Number, or Date and time. A data type is the value your script reads or returns, such as text, number, date, datetime, record, or array.
For deeper explanations and examples, open Operators and Explore core scripting elements.
Jump to: Data types · Operators · Conversions · Common gotchas
Data types
Data types describe what an expression returns or a variable stores. Knowing the type helps you choose the right operator and conversion.
Map common field types to scripting values
These mappings help you keep Builder terminology and scripting terminology separate:
Text and Multi-line text fields return Text values.
Number fields return Number values.
Yes/no fields return Yes/No values.
Date fields return Date values.
Date and time fields return Datetime values.
Time fields return Time values.
Appointment fields return Appointment values.
Relationship fields return Record references or lists of records.
File, Location, and User fields return specialized values of the same kind.
Views, Charts, Controls, Layouts, and Dynamic elements are builder components, not scripting data types.
Start with the core types
Most scripts use these types first:
Text stores labels, messages, and other words, for example
"Hello"or---Hello {'First name'}!---.Number stores values you calculate with, for example
125or19.95.Yes/No stores
trueorfalse. Comparison operators return this type.
Use date and time types for scheduling
Use different time-related types depending on what you need to keep:
Date stores a calendar date without a time, for example
today()ordate(2026, 3, 23).Time stores a time of day, for example
time(14, 30).Datetime stores a local date and time together, for example
datetime(2026, 3, 23, 14, 30).Timestamp stores a time-based value in timestamp form, for example
timestamp(now()).Appointment stores a start and end together, for example
appointment(now(), timeinterval(1, "hours")).Duration stores a time span, for example
duration(End, Start).
Use structured types to work with records and data
These types help when you move beyond simple values:
Record stores a reference to one record, for example
first(select Customers). Use.to access its fields.Array stores a list of values, for example
[1, 2, 3]orselect Invoices.JSON stores structured key-value data, for example
parseJSON("{\"status\":\"Open\"}").File stores a file reference, for example
file(Attachment).Location stores a place with coordinates, for example
location("Office", 52.52, 13.405).User stores a workspace user, for example
user().
Operators
Operators let you assign, calculate, compare, and access values. Choose them by the job you want to do.
Assign and access values
Use these operators to store values and read data:
:=assigns a value to a variable or field, for examplelet total := Price * Quantity..accesses a field on a record or a value in an object, for examplecustomer.Name.;ends a statement, for examplelet total := 100;.
Calculate with arithmetic operators
Use arithmetic operators for totals, quantities, percentages, and similar calculations:
+adds numbers and can also join text, for example1 + 2or"Hello " + 'First name'.-subtracts one number from another, for exampleNet - Discount.*multiplies numeric values, for examplePrice * Quantity./divides one number by another, for exampleTotal / 4.%returns the remainder after division, for example13 % 5.()changes the order of calculation, for example(1 + 2) * 3.
Compare values in conditions
Use comparison operators when a script needs to decide what happens next:
=checks whether two values are equal, for exampleStatus = "Open".!=checks whether two values are different, for exampleStatus != "Closed".>and>=check whether the left value is greater.<and<=check whether the left value is smaller.likechecks whether one text appears inside another text, for example"Hello" like "ell".
Combine conditions
Use logical operators when one check is not enough:
andrequires both conditions to be true, for exampleStatus = "Open" and Total > 100.orrequires at least one condition to be true, for exampleStatus = "Open" or Status = "Pending".
Write text and field names correctly
Use the right syntax for text and names:
""marks a text value, for example"Open".---marks a longer text value, for example---Hello {'First name'}!---.''wraps field or table names with spaces or special characters, for example'First name'.
Conversions
Use conversions when a value has the right content but the wrong type.
Use these functions most often:
text(any)converts a value to readable text. Use it when you build messages such as"Order " + text(Number).number(any)converts a value to a number. This helps when imported values arrive as text.date(any)converts a value to a date and removes the time part when needed.datetime(...)creates or converts a local date and time value.timestamp(any)converts a time-based value to a timestamp.parseJSON(string)converts JSON text into a JSON object.formatJSON(JSON)converts a JSON object into JSON text.
Common pitfalls
These are the mistakes that come up most often:
Use
:=to assign values. Use=to compare values. It is easy to confuse them when you switch from writing logic to checking a condition.Use single quotes for field or table names like
'First name'. Use double quotes for text like"Hello". Mixing them changes how Ninox reads the expression.+can add numbers or join text. If one part is not already text, convert it first withtext(), for example"Order " + text(Number).likechecks whether one text appears inside another text. Use=when values must match exactly.The dot operator needs a record or object value on the left side, for example
let customer := first(select Customers); customer.Name. If the left side is not a record, Ninox cannot read the field.
Last updated
Was this helpful?