Introduction
Dropdown lists are a fundamental part of building user-friendly web applications in Oracle APEX. They allow users to select from a predefined set of options, ensuring data consistency and simplifying input. Whether you’re working with static values or pulling data from a table, adding a dropdown list (also called a select list) is quick and highly customizable. In this guide, we'll walk through how to create a dropdown list step-by-step using both static and dynamic data sources.
A dropdown list (also known as a select list) allows users to choose a single value from a list of options. This is commonly used for selecting items like departments, statuses, or categories.
Step-by-Step Guide: Adding a Dropdown (Select List)
Step 1: Go to Page Designer
-
Open your Oracle APEX application.
-
In the App Builder, click on the page where you want to add the dropdown.
-
Click Page Designer to edit the layout.
Step 2: Create the Dropdown Item
-
In the Layout pane, select the region (or create a new one) where you want the dropdown to appear.
-
Right-click the region, and choose Create Page Item.
-
In the Type dropdown, select Select List.
-
Enter a name, such as
P1_STATUS
orP1_DEPT_ID
. -
Set a Label (e.g., "Select Status").
Step 3: Define the List of Values (LOV)
You must now define the list of choices that appear in the dropdown.
Option A: Static Values
-
In the Settings section for the Select List, go to List of Values.
-
Choose Type:
Static Values
. -
Click Edit Static Values.
-
Add entries like this:
Display Value Return Value Active A Inactive I Pending P -
Click OK to save.
Option B: Dynamic SQL Query
-
Set Type:
SQL Query
. -
Enter a SQL statement, such as:
SELECT department_name d, department_id r FROM departments ORDER BY department_name
-
d
is the display value (shown in dropdown) -
r
is the return value (stored in the item)
-
-
Optionally check Display Null Value if you want an empty default option.
Step 4: Set Default Value (Optional)
-
Under the Source section, set a Default value if needed.
-
You can use a static value, an SQL query, or PL/SQL.
Step 5: Save and Run
-
Click Save (or press
Ctrl + S
). -
Click Run to preview your page.
-
The dropdown should now be visible and working.
Notes
-
The dropdown item’s value can be referenced using
:P1_STATUS
or:P1_DEPT_ID
in SQL or PL/SQL. -
You can use it as a filter in reports or as an input for a form.
-
Dropdown items can be made dependent using Cascading LOVs if needed.
Summary
To add a dropdown list in Oracle APEX:
-
Open Page Designer.
-
Create a new Select List page item.
-
Define the List of Values using static entries or a SQL query.
-
Optionally set a default value.
-
Save and run the application to test it.
Certainly. Below is an introduction and conclusion paragraph written in plain text, using Arial font (if supported by the display environment), for a blog post titled:
Conclusion
Adding a dropdown list in Oracle APEX is a straightforward yet powerful way to enhance user interaction and control input values. Whether you're filtering reports, capturing form inputs, or driving conditional logic, the select list component integrates easily with the rest of your application. By understanding how to configure it properly, you can build more dynamic, efficient, and user-friendly pages with minimal effort.
Example
Add a “Select One” dropdown box.
Select the List of Values to SQL Query
Add the SQL code
In this case we’re using the DEPT table from APEX
The query is as follows:
select
DEPT.DEPTNO || ' ' || DEPT.LOC as LOC , DEPT.DNAME as DNAME
from DEPT DEPT;
The dropdown displays as follows: