> 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/work-with-functions/user-interface.md).

# User interface

User interface and navigation functions shape what users see and where they go next. This chapter shows you how to prompt users.

{% hint style="info" %}
All UI-bound functions in this chapter run only on the client. They have no effect on the server.
{% endhint %}

<table><thead><tr><th width="224.484375">Function (A-Z)</th><th>Task</th></tr></thead><tbody><tr><td><code>alert()</code></td><td>Show a simple message</td></tr><tr><td><code>dialog()</code></td><td>Show a dialog with answer options</td></tr></tbody></table>

## Show messages and call up records

Use these functions when you want to guide users with a message or show record details without changing the main view.

### Show a simple message with `alert()`

Use `alert()` to show a pop-up with a message and an **OK** button.

Use it when you want to:

* Confirm a successful action.
* Warn about missing input.
* Show information the user should acknowledge before continuing.

`alert(any)`

* `any`: the value or message to show

`alert()` returns no value.

#### Let’s take a look at some examples:

```ninox
alert("I am a pop-up. Please click 'OK' to confirm.")
```

Shows a pop-up with an **OK** button.

```ninox
alert("This was the time at the very moment you clicked the button: " + time(now()) + ".")
```

Shows the current time when the pop-up opens.

Tips:

* Keep messages short.
* `alert()` runs only on the client.
* If one script calls `alert()` several times, only the last call is shown.
* Use `dialog()` when users need a choice, not just confirmation.

### Ask for confirmation with `dialog()`

Use `dialog()` to show a dialog with a title, message, and answer options.

Use it when you want to:

* Ask the user to review one decision.
* Let users choose between clear answers such as `Yes` and `No`.

`dialog(string, string, [string])`

* first `string`: the dialog title
* second `string`: the dialog message
* third `[string]`: the answer options to show

`dialog()` returns the selected answer as a string.

The script waits until the user picks an answer.

#### Let’s take a look at some examples:

```ninox
dialog("Confirm", "Are you sure you want to delete the record?", ["Yes", "No"])
```

Opens a confirmation dialog for a delete action.

```ninox
let title := "Delete record";
let message := "Should this record be deleted? Are you 100% sure?";
let answerOptions := ["Yes, get rid of it.", "No! I still need it!"];
if dialog(title, message, answerOptions) = "Yes, get rid of it." then
    delete this
end
```

Deletes the current record only if the user confirms.

```ninox
dialog("Duplicate!", "Do you want to keep the duplicated product name?", ["No", "Yes"])
```

The user is asked to double-check the questionable input.

Tips:

* `dialog()` runs only on the client.
* Store the result in a variable when later steps depend on the answer.

## Common UI and navigation recipes

These short patterns cover common ways to guide users through an app.

### Show short success feedback

```ninox
alert("✔ Email sent!")
```

Shows immediate feedback after a successful action.

### Ask for delete confirmation

```ninox
dialog("Confirm", "Delete this record?", ["Yes", "No"])
```

Prompts the user before a destructive action.


---

# 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/work-with-functions/user-interface.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.
