Skip to main content

Command Palette

Search for a command to run...

Oracle APEX Search: A Hidden Gem for Faster App Navigation

How to implement a search feature to improve user efficiency

Updated
5 min read
Oracle APEX Search: A Hidden Gem for Faster App Navigation
T

Oracle APEX developer at Pretius

There is one underrated feature that will help your customers use their applications more efficiently. The feature is Search.

Many times, users need to search for something in the application. Usually they have to go to a page with main report (like Employees page) and then search for the records. Your users can skip this path and if you implement a search feature with some additional styling, it can be accessed globally and look really cool.

Search configuration and options

Search is not a brand-new feature, it has been available in APEX for a few years. But what makes the search feature really useful is good placement and good search columns selection. And that's what I would like to demonstrate in this article.

To implement it, you will have to setup three components.

  • Search configurations - in shared components

  • Search region - a region of type Search, with template Search Result Container

  • Search page item - page item that will be linked to the Search region

To demonstrate how useful this feature can be, I will show you how to set it up.

Search configurations

Search configurations are the backend of the Search feature. You can find them in Shared Components, under the Navigation and Search section (it may differ in a different Apex version).

When you open it, you will be presented with a list of configurations. There are multiple types of searches, the most basic is the Standard - where you can define a basic sql query. But there are also more advanced configurations like Oracle Vector Search. So it can be very fast and efficient.

For demo purposes I created 2 configurations, both Standard type.

There are a lot of details that you can define in the configuration. First it is a Source, then searchable columns - very important. If you set up good columns for your use case, the search will be fast and users will get the results they want, but if you add all the columns, it may be rather confusing than helpful.

Next section will let you choose what columns you want to show in the search results. You can show up to 8 columns. There is also an Icon/CSS section and Link section. Link can be customised to pass values to any page or custom url.

This is how the full card with all the columns defined looks like (below).

Search Region

This is the main UI element of the search, it represents the list of results.

Usually it is placed in breadcrumb, but I want to show a different approach - so I set my search region in top navigation bar on page 0.

The type is Search and template Search Results Container.

I used 2 search configurations, one is set to be used as "Initial result". So when user clicks on the search, it is automatically shown. And the second is shown only if user types something in the search page item.

It is also possible to define your own template. If you select Custom Layout, you can define HTML Row template.

For this demonstration, I keep everything as default. I will just add some CSS in the end, to make it look better.

Search page item

Last piece of the puzzle is the search item. It is a simple text field, that is set as "search page item" in the attributes of the search region. I placed it in the navigation bar, right in front of the Search region. I also added some pre and after html, to show custom icon and close button.

Initial results

This is how it looks without any css, it stretches the navigation bar with all the results.

I applied some css (application is available for download in the bottom of the article), that will adjust the behaviour and styles. It is nothing super sophisticated, but it looks much better now.

In my opinion, there are 2 important things that make the feature useful. First is the placement - the navigation bar is always visible and it will not take any real estate from reports and other page components. So I think it is really a good place for the search.

The second is the configuration, especially the Searchable columns. If you set up the right columns, it will give you incredible search power.

In my case, I can for example look for all employees named Davids, all programmers or all managers, but only from specific department. Like "manager shipping". The search is able to combine the strings you use and give you valid results.

Talk is cheap, show me the code!

I hope you will go and implement the search feature in every application you make.

The demo application is available here. And if you want to download it and test it yourself, the file is here.

Thank you for reading the article and have a nice day!