Search settings
The Search menu (the magnifying glass icon on the map) allows you to offer custom search forms to your users. The Search settings tool lets you create any number of custom search forms, helping users quickly and accurately locate specific objects on the map (e.g., addresses, parcels, manhole numbers).
Note: Search settings are only available to application administrators and users with permission to edit the workspace.
Each search form consists of a main button in the menu and one or more input controls that define the search parameters and query your database.
Dynamic display of search tools based on active workspace layers
An application database can contain dozens or even hundreds of tables, but a user typically only works with a specific subset of layers displayed on the map within their current workspace. To prevent confusion and errors, the application dynamically filters the available search forms.
How it works
- Automatic layer validation: Every time the user opens the Search menu (by clicking the magnifying glass icon), the system inspects all configured search forms and compares their target layers against the layers currently loaded in the active workspace.
- Smart visibility filtering: If a search form relies on a target layer or dropdown table that is not present in the active map view, its button is automatically omitted from the menu.
- Universal tools exception: General search forms that do not depend on specific map layers (such as the Coordinate Search) remain available at all times.
- Real-time updating: The list of available search buttons refreshes every time the search panel opens. If a user adds new layers to the map or removes existing ones during their session, the search menu immediately updates without requiring a page refresh or application restart.
When this comes in handy
- Eliminating query errors: Prevents users from executing queries on layers that are not n-memory/on the map, which previously resulted in application errors or blank results.
- Clutter-free and clean interface: Keeps the Search menu concise and clear. Users are not overwhelmed by dozens of irrelevant buttons for layers they are not currently viewing.
- Domain-specific workspaces: Allows creating targeted workspaces for different municipal or utility tasks (e.g., "Water Supply", "Sewerage", or "Cadastre"). Opening the "Water Supply" workspace will only display search forms related to hydrants, valves, and pipelines, while hiding gas or cadastral searches.
- Flexible ad-hoc workflows: If an operator is working on a water network map and decides to add the "Parcels" layer to perform cross-referencing, opening the Search menu immediately reveals the "Parcel Search" button. Once the parcel layer is removed from the map (Remove Layer), the search button automatically disappears while the table remains open for the Browser and lookups.
Search form settings
In this section, you define how the search tool will be displayed in the main search menu on the map.
- Button label: The name of the search tool that will appear on the button (e.g., "Address" or "Landmark").
- Button width: Determines how much width the button will take up in the menu (e.g., full width, half width). This is useful for grouping multiple small search buttons in a single row.
- Button color: Choose a button color to provide better visual distinction between different types of searches.
- Divider and caption: Adds a visual horizontal line before the button. If you enter text, it will be displayed as a caption above the line, making it perfect for logically grouping items (e.g., grouping all infrastructure searches under one title).
Search control settings
Every search form can contain one or more controls (input fields or dropdown lists) through which the user provides search criteria.
General control settings
- Control type: You can choose between an Input field (for manual typing, e.g., numerical IDs) or a Dropdown list (for selecting values from the database via an SQL query).
- Placeholder: The hint text displayed in an empty field to guide the user (e.g., "Enter street name...").
- Control width: Determines the width of the input field within the form (e.g., full width, one-third width).
- Required: If enabled, the user cannot execute the search until this field is filled.
Target layer connection
The system needs to know where and what to search for on the map when the user submits a value.
- Target layer for selection: The name of the database table (layer) where the searched objects are located
(e.g.,
water_hydrants). - Search column: The name of the column in the target layer that must match the input/selected value (e.g.,
hydrant_idor__id__). - Data delimiter: Used if the input field allows searching for multiple objects simultaneously (e.g.,
entering multiple parcel numbers separated by a comma
,). - Add to query string: If you have chained/linked fields (e.g., City + Street), this passes the control's
value to the next control's SQL query as a parameter (
?).
Dropdown list settings (SQL)
If you select a Dropdown list, you must populate it with data from the database:
- SQL query (dropdown values): The SQL statement that returns the list of values. For dynamic text
searching, insert the
{$}parameter (e.g.,WHERE name LIKE '\%{$}%'). - Key column (from SQL): The column name from the SQL query that acts as the unique identifier (the key,
e.g.,
__id__). This is used to query the target map layer. - Display value column (from SQL): The column name from the SQL query that is actually shown to the user (e.g., Street Name).
- Search fields: Specify the columns (comma separated) to use for filtering the dropdown when the user types.
- Load on demand: Crucial for cascading/multi-level searches (e.g., selecting a city, then a street). The control will only fetch data after the preceding field is populated.
- Allow empty input: Allows the search to execute even if the user leaves this dropdown empty (e.g., searching for an entire street without selecting a specific house number).
Important rules for advanced searches
- Order of controls: The order of controls in the form is crucial. The 'Add to query string' option
passes the selected value as a parameter (
?) exclusively to the next control in the sequence that has 'Load on demand' enabled. - Difference between `?` and `{$}`: For dynamic filtering within the dropdown list itself, use the
{$}tag (e.g.,LIKE '\%{$}%'), which inserts the text currently being typed by the user into the SQL. To retrieve a value from a preceding control (cascading), use the question mark?(e.g.,WHERE city_id=?). - Row ID (__id__): The unique internal identifier of the record in the local database (applicable exclusively to the specific device).
- Target layer and `__id__`: The Key column from the SQL query must ultimately match the Search column on
the Target layer (otherwise, the system won't find the object on the map). A very common and safe practice is to
use the system column
__id__when querying the same table that serves as the target layer. - Case-insensitive text search (`COLLATE NOCASE` / `LOWER_UTF8`): When searching text fields using the
LIKEoperator and the{$}tag (e.g.,WHERE name LIKE '\%{$}%'), SQLite is case-insensitive for standard ASCII letters by default. To guarantee proper case-insensitive matching for extended UTF-8 characters and accented letters (e.g., č, š, ž), appendCOLLATE NOCASEto your SQL query or use the function LOWER_UTF8() (e.g.,WHERE LOWER_UTF8(name) LIKE LOWER_UTF8('%{$}%')).
Search Form Examples
1. Simple input field (Hydrant number)
The user manually enters a hydrant ID. The system queries the table directly for a match.
- Control type: Input field
- Target layer for selection:
water_hydrants - Search column:
hydrant_id - Required: Enabled
2. Dropdown list with text search (Landmark Search)
The user types part of a landmark's name, and the dropdown dynamically offers matches from the database (using an SQL LIKE filter).
- Control type: Dropdown list
- SQL query:
SELECT __id__, landmark_name FROM landmarks WHERE landmark_name LIKE '%{$}%' AND landmark_name <> '' ORDER BY landmark_name LIMIT 100 - Key column:
__id__ - Display value column:
landmark_name - Target layer / Search column:
landmarks/__id__
3. Cascading multi-level search (Address: City and Street)
The user first selects a city from the first dropdown. The second dropdown then loads on-demand, showing only streets that belong to that specific city.
- Control type: Dropdown list
- SQL query:
SELECT city_id, city_name FROM cities ORDER BY city_name - Key column:
city_id(This is passed to the next control using?)
- Control type: Dropdown list
- Load on demand: Enabled (Data loads only after a city is selected)
- SQL query:
SELECT __id__, street_name FROM streets WHERE city_id=? ORDER BY street_name - Key / Display value column:
__id__/street_name - Allow empty input: Enabled (If left blank, the search might highlight the entire city)