# Get UI Number

The **Get UI Number** building block finds and extracts a number in an application (or from within a specific UI element) in an already open application window when working with Desktop UI automation.

**Note:** The screenshot on this page uses the **Elegance Design**, introduced in **2025.3**. If you are using an earlier version, your layout may look different.

## Quick-start

1. Drag **Get UI Selection** onto the canvas.
2. Connect the block in the flow and specify **Select UI Element**, **Get selection as**, and (if needed) Source element, Use occurred, and timeout-related settings.
3. Run the flow when it’s ready.

## Building block parameters

### Parameters
- **Block header**: The green input connector triggers the block to start executing. The green output connector triggers when a number has been successfully found. You can rename the block title (“Get UI Number”) by double-clicking it and typing in a new title.

- **Select UI Element**: Contains the locator for the UI element from which the number is found. You can capture a locator by clicking and selecting **Capture new element**, edit it via **Edit element**, and clear it via **Clear element**.

- **Number found**: Contains the number that was found. This output can be connected and used in other building blocks.

- **Not found**: Triggers if a suitable number is not found within the configured timeout. If nothing is attached to this connector and the element is not found, the case ends with status **Fail**. You can use this connector to branch the flow depending on whether the number is found.

- **Split lines**: Controls how text from multiple child elements is combined when the captured element contains more than one child element (for example a panel with multiple labels). By default, values are separated by a space; when **Split lines** is selected, values are separated by a new line.

- **Position found**: The screen position where the UI element was found in **X, Y** coordinates, relative to the screen’s top-left ( **0, 0**). In multi-screen setups, X/Y can be negative or larger than the main screen resolution depending on which screen the window is on. You can expand to work with X and Y separately. Non-visible UI elements have position **0, 0**.

- **Area found**: The position and size of the found UI element in **X, Y, Width, Height** coordinates, starting at the upper-leftmost pixel, relative to the screen’s top-left ( **0, 0**). In multi-screen setups, X/Y can be negative or larger than the main screen resolution depending on which screen the window is on. You can expand to work with position/size and nested sub-properties separately.

- **Source element**: Limits the UI element locator to work inside the provided source element instead of the originally captured element. This is useful, for example, to capture a table row first and then find a specific cell within that exact row.

- **Find format**: Defines a format the number must match to be captured. For example, with `Price: [NUMBER] USD`, the block returns `123.00` from `Price: 123.00 USD`.

- **Is case sensitive**: Controls whether **Find format** is case sensitive. By default, it is case-insensitive.

- **1000 separator**: Defines the character used to separate thousands. By default, this uses Flow’s Windows regional settings (typically “,” or “.”).

- **Decimal separator**: Defines the character used to separate decimals. By default, this uses Flow’s Windows regional settings (typically “,” or “.”).

- **Filter**: Defines a filter the number must meet to be accepted (for example, only retrieve numbers **Greater than** 100). If the number found does not match the filter, **Not found** is triggered.

- **Use occurred**: Selects which occurrence of the number to use if more than one is found. Select **All** to iterate through all occurrences; this shows **Current index** and **Completed**, and the top connector triggers for each occurrence.

- **Current index**: When iterating through all occurrences, contains the current index for the number being processed.

- **Completed**: Triggers when the iteration of all occurrences has completed.

- **Count**: Contains the total number of found occurrences that match the configured locator and criteria.

- **Default timeout**: If the checkbox is not selected, the timeout is **10 seconds**. If the checkbox is selected, the **Default timeout** value from the flow settings applies.

- **Timeout**: The maximum time spent searching for a number before giving up and triggering **Not found**. This is separate from the case **global timeout** in **Settings**, which can cancel a run if the whole case exceeds it.

- **Scroll to find**: When set to a value other than **None**, the block uses scrolling while searching for the UI element. This can be useful in scrollable content where elements load asynchronously (for example infinite scroll).

- **Max repeats**: The maximum number of times to perform a scroll before giving up searching for the UI element/number.

- **Amount**: The amount of scrolling that will be performed on each scroll repeat.

- **Delay (sec)**: The delay in seconds between each of the scroll amounts.

- **Await no changes**: When selected, the block waits until there have been no changes on screen for the configured period before attempting to find the number in the specified element.

- **Await Timeout**: The number of seconds the screen must have had no changes before the block proceeds.

## Resources

Enlarges the table by opening it in a full screen dialogOpen

| **Topic** | **Description** |
| --- | --- |
| [Flows FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/flows-faq) | Common questions about creating, running, and managing flows in Leapwork. |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.
