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
trueorfalse
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
ifconditions 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.
:= 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
In Ninox scripting refer to field or table names with the internal name and not the label. Internal names must not contain any spaces or special characters and must be unique. Ninox autogenerates the internal name, but you are free to change it. For example, if the label is "First name", the autogenerated internal name will be "first_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
myNand stores the number1000.The second line updates
myNand replaces the old value with2.The third line writes the text
Hello world!into the fieldText.
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
1000inmyX.Ninox stores
500inmyY.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_namereads the field value."!"adds the closing punctuation.If
first_namecontainsSam, the result isHello Sam!.
This example combines fixed text with a number.
choicesreturns 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 customersreturns records from the "Customers" table.first(...)takes the first record from that result.The dot operator reads the value in the
namefield 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.
+ 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
pricebyquantity.Ninox stores that result in
myTotal.The second line subtracts
discountfrommyTotaland stores the new result inmyDiscounted.
Understand modulo
The modulo operator % returns what is left after integer division.
This example shows how modulo returns the remainder.
Ninox divides
13by5.The integer result is
2, because5fits into13two times.After that division,
3is 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 gives6.It then adds
1.The final result is
7.
This example shows how parentheses change the calculation order.
Ninox first adds
1 + 2, which gives3.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:
truefalse
In a Yes/No field, Ninox shows these results as Yes and No.
= 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
totalis greater than100.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
statuswith the textOpen.If both values match exactly, it shows the alert.
This pattern is useful for reminders, validation, and workflow checks.
Compare text with like
likeUse 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
elappears anywhere insideHello.Because
Hellocontainsel, the condition returnstrue.
This example shows that like is not symmetric.
Ninox checks whether the shorter text
elcontainsHello.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
ifstatement checks whether that total is greater than100.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_nameandlast_name.It joins both values with a space and stores the result in the variable
myFullName.The
ifstatement checks whetherlast_nameis 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 innumberinto 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?