Operators

Learn how to calculate, compare, assign, and access values with operators in Ninox logic.

Operators are the small symbols and keywords that make Ninox logic work. You use them to calculate totals, compare values, store results, and access data.

This page shows each operator as a symbol and by name.

That makes it easier to recognize operators here and reference them consistently in other chapters.

In this chapter, you will learn how to:

  • Assign values to fields and variables

  • Work with text, record fields, and structured data

  • Calculate values with arithmetic operators

  • Compare values and return true or false

Choose the right operator

Use these operator groups for different tasks:

  • Write values and references for assigning values, writing text, and accessing fields

  • Arithmetic operators for totals, quantities, discounts, and other calculations

  • Comparison operators for checks inside if conditions and filters

If you are just getting started, focus on +, -, *, /, =, !=, :=, and . first.

Write values and references

These operators help you write valid logic, assign values, and refer to text, fields, and record data. You will use them in almost every script, even in very short ones.

Operator and name
What it does
Example

:= Assignment

Assigns a value to a variable or field.

let myN := 1000;

; Semicolon

Ends a statement, especially before another one follows.

let myN := 1000;

"" Double quotes

Marks text as a string value.

"Hello" + " " + "world!"

. Dot

Accesses a field on a record or a value in an object.

(select Customers).Name

Assign values with :=

Use := to store a value in a variable or write a value into a field.

This example does three different assignments.

  • The first line creates the variable myN and stores the number 1000.

  • The second line updates myN and replaces the old value with 2.

  • The third line writes the text Hello world! into the field Text.

End statements with ;

Use ; to separate statements.

Ninox often inserts semicolons automatically when needed, especially after let statements.

This example separates statements and combines two values.

  • Ninox stores 1000 in myX.

  • Ninox stores 500 in myY.

  • The last line adds both values and returns 1500.

Mark text with quotes

Use double quotes for text values.

This example joins three text values into one result.

  • Each part in quotes is treated as text.

  • The + operator joins the three text parts into one string.

  • The result is Hello world!.

Double quotes are also useful when you build short dynamic text with field values.

This example combines fixed text with a field value.

  • "Hello " is fixed text.

  • first_name reads the field value.

  • "!" adds the closing punctuation.

  • If first_name contains Sam, the result is Hello Sam!.

This example combines fixed text with a number.

  • choices returns the numeric index of the selected choice, which maps to a text value.

  • text(...) picks the mapped text.

  • The result becomes one text value such as Your choice: Apples.

Access values with .

Use the dot operator to access a field from a record or a value from a structured object.

This example reads one field from one record.

  • select customers returns records from the "Customers" table.

  • first(...) takes the first record from that result.

  • The dot operator reads the value in the name field of that record.

Calculate values

Use arithmetic operators to calculate values directly in your logic.

They are useful for prices, quantities, percentages, durations, and counters.

Operator and name
What it does
Example and result

+ Plus

Adds numbers. It can also join text.

1 + 2 returns 3

- Minus

Subtracts one number from another.

3 - 2 returns 1

* Asterisk

Multiplies numbers.

2 * 3 returns 6

/ Slash

Divides one number by another.

6 / 3 returns 2

% Modulo

Returns the remainder after division.

13 % 5 returns 3

() Parentheses

Changes the order of calculation.

(1 + 2) * 3 returns 9

Use arithmetic operators in everyday logic

These are typical use cases:

  • Multiply a price by a quantity

  • Add a surcharge or discount

  • Divide a total across several records

  • Check whether a number divides evenly with %

This example calculates a value in two steps.

  • The first line multiplies price by quantity.

  • Ninox stores that result in myTotal.

  • The second line subtracts discount from myTotal and stores the new result in myDiscounted.

Understand modulo

The modulo operator % returns what is left after integer division.

This example shows how modulo returns the remainder.

  • Ninox divides 13 by 5.

  • The integer result is 2, because 5 fits into 13 two times.

  • After that division, 3 is left over.

  • That is why the expression returns 3.

Control the order of calculation

Ninox follows standard operator precedence. Multiplication and division run before addition and subtraction.

Compare these examples:

This example shows the default calculation order.

  • Ninox does not calculate this from left to right.

  • It first multiplies 2 * 3, which gives 6.

  • It then adds 1.

  • The final result is 7.

This example shows how parentheses change the calculation order.

  • Ninox first adds 1 + 2, which gives 3.

  • It then multiplies that result by 3.

  • The final result is 9.

Ninox automatically formats logic for readability. It removes unnecessary spaces and parentheses, and adds spaces where useful. The calculation result does not change as long as the logic stays equivalent.

Compare values

Comparison operators check whether two values match a condition. They help Ninox decide what should happen next.

They return a Boolean result:

  • true

  • false

In a Yes/No field, Ninox shows these results as Yes and No.

Operator and name
What it does
Example and result

= Equals

Checks whether two values are equal.

1 + 1 = 3 - 1 returns true

!= Not equal

Checks whether two values are different.

"Apples" != "Pears" returns true

< Less than

Checks whether the left value is smaller.

4 * 2 < 10 returns true

<= Less than or equal to

Checks whether the left value is smaller or equal.

5 * 2 <= 10 returns true

> Greater than

Checks whether the left value is greater.

10 > 4 * 2 returns true

>= Greater than or equal to

Checks whether the left value is greater or equal.

5 * 2 >= 10 returns true

like Like

Checks whether text contains a value.

"Hello" like "el" returns true

not Is not

Checks if a condition is false

not 1 = 3 returns true

Use comparison results in logic

Comparison operators are often used in if conditions.

This example runs an action only when a condition is true.

  • Ninox checks whether the field total is greater than 100.

  • If that condition is true, it shows the message High value.

  • If the condition is false, nothing happens.

You can also compare field values directly:

This example compares a field value with a fixed text value.

  • Ninox compares the field status with the text Open.

  • If both values match exactly, it shows the alert.

  • This pattern is useful for reminders, validation, and workflow checks.

Compare text with like

Use like when you want to check whether one text value appears inside another.

This example checks whether one text contains another text.

  • Ninox checks whether the text el appears anywhere inside Hello.

  • Because Hello contains el, the condition returns true.

This example shows that like is not symmetric.

  • Ninox checks whether the shorter text el contains Hello.

  • That is not the case.

  • The condition returns false.

like checks for contained text. It does not check whether both values are identical. Use = when you need an exact match.

See operators working together

Most real scripts combine several operators in one block.

This example combines assignment, calculation, comparison, and text output.

  • The first line calculates a total and stores it in the variable myTotal.

  • The if statement checks whether that total is greater than 100.

  • If it is, Ninox builds a message by joining the text High-value record: with the calculated total.

  • text(myTotal) converts the number into text so it can be shown inside the alert message.

This example combines field access, text joining, assignment, and comparison.

  • The first line reads the fields first_name and last_name.

  • It joins both values with a space and stores the result in the variable myFullName.

  • The if statement checks whether last_name is not empty.

  • If the field contains text, Ninox shows the full name in an alert.

This example combines text creation, conversion, and assignment to a field.

  • The first line builds a new text value that starts with INV-.

  • text(number) converts the numeric value in number into text.

  • Ninox stores the complete result in the variable myReference.

  • The second line writes that value into the field reference.

Across these examples, you can see how operators help you:

  • assign values with :=

  • join text with +

  • calculate results with *

  • compare values with > and !=

Last updated

Was this helpful?