> For the complete documentation index, see [llms.txt](https://docs.ninox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ninox.com/ninox-scripting/automate-your-workflows/introduction-to-scripting-at-ninox.md).

# Introduction to scripting at Ninox

## **What is Ninox scripting** <a href="#what-is-ninox-scripting" id="what-is-ninox-scripting"></a>

Ninox scripting is the built-in language you use to tell Ninox what to do. It lets your app calculate, react, and automate.

You usually add short scripts to a field, button, or automation.

Use scripting when you want to:

* calculate values in general, or based on several conditions
* display fields and elements based on certain conditions
* update other records automatically
* run actions when something changes
* connect Ninox to another service

If Ninox already offers a built-in setting for your goal, use that first. Use scripting when you need custom logic or automation.

A small script can already do useful work:

```ninox
if total > 100 then "High" else "Normal" end
```

This script checks a value and returns a result. That is the basic idea behind many Ninox scripts.

Scripts in Ninox help you to:

* automate repetitive tasks
* calculate values dynamically
* validate input and enforce rules
* update related records
* react automatically to events
* connect Ninox to external services

### **Key concepts and terminology** <a href="#key-concepts-and-terminology" id="key-concepts-and-terminology"></a>

You do not need many terms to get started. These are the ones you will see most often:

* **Table**: a group of records of the same kind, such as invoices or contacts.
* **Field**: one value stored on a record, such as a name, date, or status.
* **Record**: one entry in a table.
* **Script**: a block of Ninox logic that reads data, returns a value, or changes data.
* **Statement**: one instruction in a script, such as `if`, `select`, or `for`.
* **Variable**: a named temporary value inside a script.
* **Data type**: the kind of value a script works with, such as Text, Number, Date, Record, or Array. (JSON is rather a *format* than a *data type*, the data type is text which has a certain structure like XML etc.)
* **Operator**: a symbol or keyword that calculates, compares, or combines values, such as `+`, `=`, `and`, or `:=`.
* **Function**: a ready-made operation such as `sum()`, `date()`, or `text()`.
* **Selection**: a list of records returned by a query such as `select`.
* **Context**: the place where the script runs, such as a field, button, or automation. Context affects what values are available.
* **Automation**: logic that runs automatically when a defined event happens.
* **Logic editor**: the editor where you write, format, and troubleshoot scripts.

{% hint style="info" %}
If these terms feel abstract, that is normal. They become clear once you see them in a short script. Find more definitions in our [Glossary](/getting-started/basics/glossary.md).
{% endhint %}

### **Where you can use scripts in Ninox** <a href="#where-you-can-use-scripts-in-ninox" id="where-you-can-use-scripts-in-ninox"></a>

You can use the same scripting language in different places:

* **Logic fields** to calculate values automatically
* **Buttons** to run actions or logic on click
* **Automations** to run logic automatically after an event
* **Queries, filters, and selections** to find and sort records
* **Integrations** to send data to or receive data from other systems

The language stays the same, but the context changes. For example, a button runs logic when a user decides it should run, while an automation runs because an event happened.

Typical examples are:

* calculate a discount in a logic field
* print and save an invoice by clicking a button
* set a status with an automation
* send data to an external service

To learn the basic language patterns, see [Explore core scripting elements](/ninox-scripting/automate-your-workflows/explore-core-scripting-elements.md). To learn automation behavior, see [Automations](/ninox-scripting/automate-your-workflows/automations.md).

### **Getting started with scripting** <a href="#getting-started-with-scripting" id="getting-started-with-scripting"></a>

Start with one small, visible result. That is the fastest way to learn.

{% stepper %}
{% step %}

### Start with a simple **Button**

Buttons are easy to test. You click once and see what happens.
{% endstep %}

{% step %}

### Learn the core building blocks

Read [Explore core scripting elements](/ninox-scripting/automate-your-workflows/explore-core-scripting-elements.md) to understand statements, variables, data types, and operators.
{% endstep %}

{% step %}

### Use the editor to work faster

Read [Logic editor features](/ninox-scripting/automate-your-workflows/explore-core-scripting-elements/logic-editor-features.md) to learn how Ninox helps you format, search, troubleshoot logic, and use AI assistance.
{% endstep %}

{% step %}

### Add more functions

Read [Work with functions](/ninox-scripting/automate-your-workflows/work-with-functions.md) when you need dates, text handling, calculations, selections, or integrations.
{% endstep %}

{% step %}

### Automate once the manual version works

Move to [Automations](/ninox-scripting/automate-your-workflows/automations.md) after your logic works reliably in a **Button** or field.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ninox.com/ninox-scripting/automate-your-workflows/introduction-to-scripting-at-ninox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
