Search This Blog

Showing posts with label Create a static LOV (Additional Example ). Show all posts
Showing posts with label Create a static LOV (Additional Example ). Show all posts

Monday, June 30, 2025

How Do I Create a static LOV (Additional Example )

 Introduction

Creating a static List of Values (LOV) in Oracle APEX is a simple and effective way to present users with a predefined set of options. Static LOVs are ideal for selections that rarely change, such as categories, status types, or fixed ratings. This method improves data accuracy and speeds up data entry by eliminating manual input errors. In this example, we’ll walk through how to create an additional static LOV and assign it to a form item.

Creating a static LOV (List of Values) in Oracle APEX is useful when you need to present users with a fixed set of options that do not change often. These types of LOVs are ideal for fields like status types, priority levels, or predefined categories. Let’s walk through an additional example where we create a static LOV for selecting a risk level in a form.

Step 1: Go to Shared Components
From your APEX application:

  • Open your app in the APEX development environment.

  • Navigate to the Shared Components section.

  • Under User Interface, click on List of Values.

Step 2: Create a New Static LOV

  • Click Create > From Scratch.

  • Enter a name for the LOV, for example: LOV_Risk_Levels.

  • Under Type, select Static.

  • Add your values manually in the Static Values section.
    For this example, enter the following:

    • Label: Low Risk, Value: LOW

    • Label: Medium Risk, Value: MEDIUM

    • Label: High Risk, Value: HIGH

  • Click Create LOV to save.

Step 3: Assign the Static LOV to a Page Item
Now that the LOV is created, assign it to a form item on your page.

  • Go to Page Designer for the target page (for example, a form page).

  • Create or select an existing page item such as P1_RISK_LEVEL.

  • Set the Type to Select List, Radio Group, or Popup LOV, depending on your preference.

  • Under List of Values, choose LOV_Risk_Levels.

  • You can optionally enable Display Null Value if you want a blank option at the top.

  • Set Label, Session State, and other settings as needed.

  • Save and run the page.

Result
Your page item now displays a list with three options: Low Risk, Medium Risk, and High Risk. When a user selects one, the corresponding value (LOW, MEDIUM, or HIGH) is stored in the database or submitted with the form.

Optional Enhancement: Inline Static LOV
Alternatively, you can define a static LOV directly in the item properties without using Shared Components:

  • Go to the page item (e.g., P1_RISK_LEVEL).

  • Set Type to Select List.

  • Under List of Values, choose Static Values.

  • Enter the values in this format:

Low Risk;LOW  
Medium Risk;MEDIUM  
High Risk;HIGH
  • Save and test.

This inline method is quicker for one-time or page-specific use, while the Shared Components method is reusable and centralized.

Creating static LOVs in Oracle APEX is fast, flexible, and ideal for consistent input where the options are known and fixed.

Example

Select the create list of values option from the Shared components > List of Values link

Select build “From Scratch”

A screenshot of a computer

AI-generated content may be incorrect.

Give the LOV a name

A screenshot of a computer

Description automatically generated


Add the static values that you desire

A screenshot of a computer

Description automatically generated

Complete and VOILA!


Conclusion
Static LOVs are an easy way to manage fixed option sets within your Oracle APEX applications. They enhance form usability, standardize user input, and require minimal maintenance. By using static LOVs where appropriate, you can simplify development and ensure that users consistently select from the correct list of values.