Input Dialog
Input Dialog
Section titled “Input Dialog”Type: input-dialog · Package: UI Activities v1.0.4 · Output: string
Shows a dialog with a text field and returns the value the user types. It is used to ask for a piece of data at the start or in the middle of an assisted automation: a document number, a date, a path.
How it works
Section titled “How it works”It shows a Windows window centered on the screen, with the prompt text above an input field (pre-filled with default, if you set it) and the Aceptar (OK) and Cancelar (Cancel) buttons. It waits with no time limit for the person to answer:
- Aceptar (or the Enter key) returns the text in the field as it was left; it can be
""if it was left empty. - Cancelar, the Esc key or closing the window return
nulland log a warning:Dialog cancelled by the user.
It needs an interactive Windows desktop: it does not work when the Agent runs as a Windows service (Session 0) or on robots without a user interface.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | — | Label text above the field. Fixed text in quotes or an expression. About two lines fit. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
title | string | "Zoan Automation" | Window title. |
default | object | "" | Initial value pre-filled in the field. It can be of any type: it is shown as text. |
Output
Section titled “Output”| Type | Description |
|---|---|
string | The text the user entered when clicking Aceptar ("" if left empty), or null if they cancelled or closed the window. |
The value is always text: if you ask for a number, convert it (for example with num(...)) before using it.
Example
Section titled “Example”Ask for a customer number, stop if the person cancels, and use it in a query:
Input Dialog prompt = "Customer number:" title = "Balance lookup" → output: numberIf condition = isEmpty(number) // empty or cancelled └─ then: Throw message = "No customer number was entered." errorType = "BusinessRuleException"DB Query sql = "SELECT * FROM Customers WHERE Number = @n" params = { "n": number } → output: customerCommon errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Could not show the input dialog. UI activities (input-dialog, message-box) require an interactive desktop and do not work when the Agent runs as a Windows service (Session 0). … | There is no desktop to show the window on. Run the Agent in an interactive Windows session, or replace the dialog with a process input argument. |
| The execution keeps waiting | The dialog waits for an answer with no time limit. Use it only when a person is in front of the screen. |
The next query fails with null | The person cancelled. Check isEmpty(number) (true for null and for empty text) before using the value. |
Related activities
Section titled “Related activities”- Message Box — show a message or ask for confirmation.
- Throw — stop the process if the data is missing.