💡 Designing Dynamic QuickPicks in Oracle APEX
🚩Introduction
Oracle APEX provides Quick Picks as a convenient way to allow users to populate page items with predefined values using a single click. While static Quick Picks are useful, real-world applications often require these values to be generated dynamically based on business rules, user roles, or underlying data.
- This blog explores how to implement Dynamic Quick Picks in Oracle APEX page items, enabling developers to build more intelligent, flexible, and user-friendly forms by driving Quick Pick values directly from database queries and runtime logic.
📑 Why Dynamic Quick Picks Are Needed
Static Quick Picks in Oracle APEX are useful for simple filtering, but Dynamic Quick Picks become essential when:
-
Filter values must be generated at runtime based on current data, user role, or context
-
Applications require data-driven filters instead of hardcoded values
-
The same Quick Picks must adapt across multiple pages or regions
-
Filter options depend on other selected filters (cascading behavior)
-
Dashboards need frequently changing filter options (e.g., latest periods, statuses, categories)
-
Multi-tenant applications require tenant-specific filter values
-
Users expect relevant, up-to-date shortcuts rather than static predefined choices
-
Maintenance overhead must be reduced by avoiding manual updates to Quick Pick values
Dynamic Quick Picks provide greater flexibility, improve usability, and ensure filters remain accurate, contextual, and scalable—making Oracle APEX applications more responsive to real-world data changes and modern UX expectations.
👉 Steps to design Dynamic Quickpicks in Oracle APEX PageItems.
Step 1:
Step 2: (Optional)
Step 3:
<div id="quickPickContainer"></div>Step 4:
--- AJAX CALLBACK CODE---
DECLARE
l_json CLOB;
CURSOR c IS
SELECT '5%' AS label, '5' AS value FROM DUAL
UNION ALL
SELECT '10%' AS label, '10' AS value FROM DUAL
UNION ALL
SELECT '15%' AS label, '15' AS value FROM DUAL
UNION ALL
SELECT '25%' AS label, '25' AS value FROM DUAL
BEGIN
apex_json.open_object;
apex_json.open_array('output');
FOR quickPicks IN c LOOP
apex_json.open_object;
apex_json.write('label', quickPicks.label);
apex_json.write('value', quickPicks.value);
apex_json.close_object;
END LOOP;
apex_json.close_array;
apex_json.close_object;
END;Step 5:
Page -> Properties -> Function and Global Variable Declartion
---- Function and Global Variable Declaration ----
var container = $("#quickPickContainer"); //Placeholder for the Quickpics created in //the pageitem inline help dialogapex.server.process("QuickPicks", {
dataType: 'text',
async: false
}, {
success: function(pData) {
let val = pData['output'];
val.map((item, index) => {
let picks = (index < (val.length - 1))? item.label + ", " : item.label; let link = $("<a>").text(picks).attr("href", "#")
.attr("title", item.label).addClass("quick-pick");
link.on("click", function() { // Page Item where the Quick Picks values will be copied
apex.item("P25_INPUT").setFocus();
$("#P25_INPUT").val(item.value);
}); container.append(link);
});
}
});Step 6:
🔥 Conclusion
Thus, implementing Dynamic Quick Picks in Oracle APEX page items can be achieved using standard APEX features and simple SQL or PL/SQL logic, without relying on hardcoded values. By driving Quick Pick entries from database tables or runtime conditions, developers can overcome the limitations of static Quick Picks and deliver more intelligent and adaptable data entry experiences.
This approach enables a flexible, metadata-driven input mechanism that fits well in enterprise forms and configurable applications. It not only improves maintainability by centralizing Quick Pick definitions in the database but also significantly enhances usability, helping users enter accurate data faster while keeping Oracle APEX applications clean, scalable, and easy to maintain.






Comments
Post a Comment