Search This Blog

Saturday, July 12, 2025

How do I refresh a table with a button

 

Introduction
Refreshing a table or report region with a button in Oracle APEX is a common requirement when building interactive, responsive applications. Whether you're updating a Classic Report, Interactive Report, or Interactive Grid, users often expect the data to refresh after performing an action—such as inserting, updating, or deleting a record—without needing to reload the whole page. In this post, you’ll learn how to configure a button to refresh a report region using dynamic actions, improving both performance and user experience.

 To refresh a table (typically a report region) with a button in Oracle APEX, you can use a Dynamic Action that triggers a Refresh on the specific region. This method avoids a full page reload and provides a seamless experience for the user, especially after data changes such as inserts, updates, or deletions.

Here is a step-by-step guide to implement this:Step 1: Create Your Report Region

  1. In the APEX App Builder, open your application and navigate to a page.

  2. Create a Classic Report, Interactive Report, or Interactive Grid region based on a SQL query.
    For example:

    SELECT * FROM TASKS ORDER BY CREATED_DATE DESC
    
  3. Give your report region a recognizable Static ID.

    • Click on the report region in Page Designer.

    • In the Advanced section, set the Static ID to something like task_report.

Step 2: Add a Button to the Page

  1. In Page Designer, click the region where you want the button to appear (above or below the report).

  2. Click the ➕ icon and select Button.

  3. Set its label to something like Refresh Table.

  4. Set a Static ID for the button (optional but helpful), such as refresh_btn.

Step 3: Create a Dynamic Action to Refresh the Report

  1. In Page Designer, under the Dynamic Actions section, click the ➕ icon.

  2. Name it Refresh Task Report.

  3. Event: Select Click.

  4. Selection Type: Choose Button.

  5. Button: Select the name of your refresh button (Refresh Table or the exact name you gave it).

  6. Under True Actions, click the ➕ icon and choose Refresh.

  7. Affected Elements:

    • Selection Type: Region

    • Region: Select your report region (e.g., task_report).

  8. Save your changes.

Step 4: Run and Test

  1. Run your application.

  2. Perform an insert or any change in data (through a form or process).

  3. Click the Refresh Table button.

  4. The report will reload and display the updated data without a full page reload.

Optional: Add a Process That Modifies Data and Then Refresh

If you want the same button to perform an action (like insert) and then refresh the table:

  1. Create a PL/SQL process (e.g., insert into TASKS) and tie it to the button using a Submit action.

  2. After submit, create a Dynamic Action on Page Load that refreshes the report region.

  3. Or, use a Dynamic Action with two steps:

    • First Action: Execute PL/SQL Code (e.g., insert).

    • Second Action: Refresh the region.

Refreshing a table in Oracle APEX using a button involves assigning a Static ID to the report region and using a Dynamic Action to trigger a Refresh on click. This approach enhances the user experience by eliminating full-page reloads and updating data in real time. With just a few declarative steps, you can add dynamic interactivity to your reports and make your applications more responsive and modern.

The goal id to refresh a table after adding an entry to the table.

Step 1- Add a table region

A screenshot of a computer

Description automatically generated

Step 2 – Name the table

A screenshot of a computer

Description automatically generated

Step 3 – Select the table name

A screenshot of a computer

Description automatically generated

Step 4 – Add a second Dynamic Action to the button

  • Select The action: Refresh

A black and white text

Description automatically generated

  • Affected Elements

    • Selection Type: Region ( the report is a region)

    • Region: Newtable (the name of the report region)

A screenshot of a computer

Description automatically generated

 Conclusion
Adding a refresh button to your APEX application is a simple but powerful way to provide users with real-time updates. By using dynamic actions to target specific report regions, you can avoid unnecessary page reloads and keep your interface responsive and modern. With just a few steps, you enable a smoother workflow that reflects changes instantly, making your APEX applications more intuitive and efficient.

How do I Add a row to a table with a button

Introduction
In Oracle APEX, providing users with a simple way to add data is essential for building efficient and user-friendly applications. One common requirement is to allow users to add a new row to a table by clicking a button. This action can be tied to a form or dynamic process, enabling seamless data entry without navigating away from the current page. In this guide, you'll learn how to configure a button in APEX to insert a new row into a table using PL/SQL logic and built-in components.

To add a row to a table with a button in Oracle APEX, you can create a form page or use a custom button and dynamic action that runs PL/SQL code. The most common use case is inserting data into a table when the user clicks a “Submit” or “Add Row” button. Below is a detailed walkthrough of how to do this using a manual insert with a button and PL/SQL process.Step 1: Prepare Your Table

Ensure that you have a table ready for inserting rows. For example:

CREATE TABLE TASKS (
  TASK_ID       NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
  TASK_NAME     VARCHAR2(255),
  ASSIGNED_TO   VARCHAR2(100),
  STATUS        VARCHAR2(50),
  CREATED_DATE  DATE DEFAULT SYSDATE,
  CONSTRAINT TASKS_PK PRIMARY KEY (TASK_ID)
);

Step 2: Create a Page with Form Items and Button

  1. In the APEX App Builder, create a new Blank Page.

  2. In Page Designer, add three page items:

    • P1_TASK_NAME (Text Field)

    • P1_ASSIGNED_TO (Text Field)

    • P1_STATUS (Select List or Text Field)

  3. Add a button to the page:

    • Label: Add Row

    • Static ID (optional but helpful): ADD_ROW_BTN

    • Position it in the Button Bar or directly under the items.

Step 3: Create a PL/SQL Process to Insert the Row

  1. In Page Designer, go to the Processing section.

  2. Click the ➕ icon to add a new Process.

  3. Name it Insert Task Row.

  4. Set Type to PL/SQL Code.

  5. Enter the following PL/SQL:

INSERT INTO TASKS (TASK_NAME, ASSIGNED_TO, STATUS)
VALUES (:P1_TASK_NAME, :P1_ASSIGNED_TO, :P1_STATUS);
  1. Set Server-side Condition:

    • When Button Pressed = ADD_ROW_BTN (or whatever button you created)

  2. Set Process Point = After Submit.

Step 4: Optional – Clear Form Items After Insert

If you want to clear the inputs after the row is inserted:

  1. Create a new Process.

  2. Name it Clear Form.

  3. Type: PL/SQL Code.

  4. Enter:

:P1_TASK_NAME := NULL;
:P1_ASSIGNED_TO := NULL;
:P1_STATUS := NULL;
  1. Set it to run After Submit, after the insert process.

  2. Set the same button condition.

Step 5: Run the Page and Test

  1. Run the application.

  2. Enter values into the fields and click the Add Row button.

  3. The new data should now be inserted into the TASKS table.

  4. You can verify by creating a Classic Report on TASKS or checking via SQL Workshop.

Optional Enhancements

  • Add Validations: Ensure required fields are filled out before insert.

  • Display Success Message: Go to Processing > Messages and define a success message.

  • Use Dynamic Actions: For more control, you can create a dynamic action that submits the page and runs the PL/SQL process when the button is clicked.

In Oracle APEX, adding a row to a table using a button is easy to implement using form elements, a submit button, and a PL/SQL process. This approach works well for custom data-entry pages or lightweight admin tools. By combining user input with backend logic, you can give your users an efficient way to add records while maintaining full control over validations, process flow, and user experience.

In this example we are going to use two fields and one table

  • Fields: P10_NEW_1 and  P10_NEW_2

  • Table:

    • Using Table1

    • Has 3 columns

      • ID

      • VALUE1 – varchar2

      • VALUE2- varchar2

    • Has 1 button: named “add”

Step 1 -Create a page with both fields and a button

Step 2- Add a dynamic Action to the button

Step 3- In the Dynamic Action TRUE section

  • In Identification choose Action: Execute Server-side Code

A screen shot of a computer

Description automatically generated

  • In the Settings

    • Language (PL/SQL)

    • PL/SQL Code: Add the following code

INSERT INTO TABLE1  (value1,value2)

 VALUES(:P10_NEW_1,:P10_NEW_2);

A screenshot of a computer program

Description automatically generated

  • In the Items to Submit enter all of the fields that you want to pass to the database. If you don’t do this then the values are not entered into the database.

A screenshot of a computer

Description automatically generated



Conclusion
Adding a row to a table with a button in Oracle APEX is a flexible and powerful technique that enhances user interactivity. Whether using a form-based approach or a dynamic action tied to a PL/SQL process, you can tailor the behavior to meet your application's needs. Once set up, this functionality streamlines data entry, minimizes user effort, and helps maintain clean, consistent records throughout your application.

 

How do I Create a Classic Report with data entry form

 Introduction
Creating a Classic Report with a data entry form in Oracle APEX allows developers to display existing records while enabling users to input or update data through an integrated form. This is a common design pattern for applications that manage records such as customers, orders, or tasks. The Classic Report presents data in a clean, readable format, while the form provides a user-friendly interface for creating or editing records. This blog will walk you through the steps to build this structure in a way that’s efficient, intuitive, and fully integrated with your APEX application.

 To create a Classic Report with a data entry form in Oracle APEX, you'll use two main components: a Classic Report to display existing records and a Form to allow users to add or edit individual records. Oracle APEX provides a built-in wizard to create this type of Master-Detail interface efficiently. Below is a step-by-step guide to building it.

Step 1: Prepare Your Table
Before building the pages, ensure you have a table in your database to work with. For example, a simple CUSTOMERS table with the following columns:

CREATE TABLE CUSTOMERS (
  CUSTOMER_ID NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY,
  FIRST_NAME  VARCHAR2(100),
  LAST_NAME   VARCHAR2(100),
  EMAIL       VARCHAR2(150),
  CREATED_AT  DATE DEFAULT SYSDATE,
  CONSTRAINT CUSTOMERS_PK PRIMARY KEY (CUSTOMER_ID)
);

Step 2: Create a New Classic Report with Form Page

  1. Open your application in APEX.

  2. From the App Builder, click Create Page.

  3. Choose Report > Classic Report.

  4. Select With Form – this tells APEX to generate both the report and the form.

  5. Choose your table (e.g., CUSTOMERS).

  6. Select the primary key column (APEX usually detects this automatically).

  7. Define the navigation:

    • You can let APEX create a navigation button or link from a column to the form.

  8. Optionally include Create and Delete capabilities.

  9. Click Next and Create.

This process generates two pages:

  • A Classic Report page (e.g., Page 1) that displays your table rows.

  • A Form Page (e.g., Page 2) where you can view or edit a single row.

Step 3: Configure the Classic Report

  • Go to the report page in Page Designer.

  • Under Columns, locate the link icon next to the primary key column.

  • Click it and review the Link settings—it should navigate to the Form page, passing the primary key value as a parameter (e.g., P2_CUSTOMER_ID).

  • You can also enable a Create button to add new records:

    • Under Buttons, find the Create button.

    • It should link to the Form page without a primary key value, which triggers Insert mode.

Step 4: Configure the Form Page

  • On the Form page, APEX will automatically include processes like:

    • Fetch Row from CUSTOMERS (runs when the primary key is passed)

    • Process Row of CUSTOMERS (handles insert/update based on mode)

    • Delete Row from CUSTOMERS (if you enabled delete)

  • The page items (e.g., P2_FIRST_NAME, P2_EMAIL) will be automatically mapped to the table columns.

  • You can customize item types, labels, validations, and default values.

Step 5: Save and Run the Application

  • Click Save.

  • Run the report page.

  • You should see a list of records with an Edit link and a Create button.

  • Click Edit to modify existing records.

  • Click Create to add a new customer.

Step 6: Optional Enhancements

  • Add validations to ensure fields like email are correctly formatted.

  • Add dynamic actions (e.g., show/hide items based on input).

  • Use Interactive Report instead of Classic Report if you need filtering and export options.

  • Use APEX page authorization to restrict access to the form.


Creating a Classic Report with a data entry form in Oracle APEX allows users to view and manage data in a structured and user-friendly way. Using the built-in wizard, you can quickly generate both pages and wire them together using standard APEX features. With a few customizations, you can turn a simple report/form interface into a powerful data management tool.

 

In Oracle Application Express (APEX), integrating a Classic Report with a data entry form on the same page enhances user experience by enabling both data viewing and input within a single interface. To achieve this integration, follow these steps:

  1. Create the Classic Report:

    • Utilize the Create Page Wizard in APEX to generate a Classic Report based on your chosen data source. This process involves specifying the report's data source, such as a table, view, or SQL query, and configuring attributes like the report's name and navigation settings. 

  2. Create the Data Entry Form:

    • Within the App Builder, initiate the creation of a new page and select Form as the component type.

    • Choose the appropriate form type, such as Form on a Table or Form on a SQL Query, depending on your data structure.

    • Define the form's attributes, ensuring it targets the same data source as your Classic Report to maintain consistency. 

  3. Link the Report and Form:

    • In your Classic Report, configure a link (e.g., an Edit button) that directs users to the same page but switches the page mode from Report to Form.

    • Pass the primary key of the selected record as a parameter in the URL to identify the specific record for editing.

    • On the form page, utilize this parameter to retrieve and display the corresponding record, allowing users to edit the data seamlessly. 

This setup allows users to view data in the Classic Report and edit individual records using the form, streamlining data management tasks.

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.


A screenshot of a computer

AI-generated content may be incorrect.

Is critical that you pay attention to the following fields: 

A screenshot of a computer

AI-generated content may be incorrect.


Select the primary key.

A screenshot of a computer

AI-generated content may be incorrect.


You should now have two new pages with the names that matches what you entered in the previous screens.

A screenshot of a computer

AI-generated content may be incorrect.


Note: if you try running the ClassicReport_Form by itself you will get the following error:

A green background with white text

AI-generated content may be incorrect.


When you run the “ClassicReportWithForm” page you get the following result:

A screenshot of a computer

AI-generated content may be incorrect.

If you click on the “Pencil” link you get the modal “form” page.

A screenshot of a computer

AI-generated content may be incorrect.

Notice that the “State_ID” field displays as a deropdown with all of the states.

A red rectangle with a white border

AI-generated content may be incorrect.

If you click on the control you see the list.

A screenshot of a computer

AI-generated content may be incorrect.

You also get some “pre-wire” buttons for the form:

Conclusion
Combining a Classic Report with a data entry form in Oracle APEX creates a seamless experience for both viewing and managing data. This setup is ideal for business users who need to browse records and make quick edits or additions. By following the correct steps and using APEX’s declarative features, you can build a robust and user-friendly interface that keeps your application clean, responsive, and functional.

How do I Change a Report’s Column Display Name

 

Introduction
When building applications in Oracle APEX, it's important to present data in a way that's clear and user-friendly. One common adjustment developers make is changing the display name of a report column to something more meaningful than a database column name like "EMP_ID" or "CUST_CODE." APEX makes it easy to customize these headings without altering the underlying data structure. In this guide, you’ll learn how to update the column display name in your reports to better reflect business language and improve the overall user experience.

 To change a report’s column display name in Oracle APEX, you can update the column heading in the report attributes. This allows you to show a user-friendly name instead of the default column name derived from the SQL query or table definition. You can change the heading for Interactive Reports, Classic Reports, or Interactive Grids, and it does not affect the underlying data structure—only how it's displayed to the user.

Here’s how to change the display name step-by-step:

1. Navigate to the Page Designer

  • Open your APEX application in the development environment.

  • Click the page that contains the report you want to modify.

  • The page will open in Page Designer view.

2. Select the Report Region

  • In the Layout or Rendering pane, find your report under the “Regions” node.

  • Click the name of the report (e.g., "Employees Report" or "Sales Grid").

3. Locate the Columns Section

  • Under the selected report region, expand the Columns node.

  • You’ll see a list of all report columns defined for that region.

4. Change the Column Heading

  • Click on the column whose display name you want to change.

  • On the right-hand side (the Property Editor), look for the Heading section.

  • In the Heading field, enter the new display name you want the user to see.

    • For example, change EMPLOYEE_ID to Employee ID

    • Or change TOTAL_SALES to Total Sales (USD)

5. Save and Run

  • Click the Save button (or press Ctrl+S).

  • Click Run (the green arrow icon) to preview the report.

  • You’ll now see the updated column heading in the report output.

Optional Notes:

  • You can use substitution strings or dynamic translations for multilingual applications.

  • If you're using PL/SQL Function Returning SQL Query, column aliases must be provided in the query itself to enable display name editing.
    Example

     

 the column's header in the report.

Additional Tips:

  • Custom Headings: If you want to define custom headings for your report columns, you can set the Heading attribute to your preferred text.

A screenshot of a computer

AI-generated content may be incorrect.



A screen shot of a computer

AI-generated content may be incorrect.

From:

A screen shot of a computer

AI-generated content may be incorrect.

To: 

A screenshot of a computer

AI-generated content may be incorrect.


A screenshot of a computer

AI-generated content may be incorrect.

  • Dynamic Column Names: For dynamic assignment of column names based on certain conditions, consider using a PL/SQL function in the report's SQL query. This approach allows for flexible column naming based on session state or other variables.


Lets make a change to David Martinez’s record and update the state.

A screenshot of a computer

AI-generated content may be incorrect.

You can see here that the change has been applied

A screenshot of a phone

AI-generated content may be incorrect.





The form also allows us to “Create” a new  user

A screenshot of a computer

AI-generated content may be incorrect.

Notice that the fields are empty and that you have a “Create” button instead of an “Update” button.

Lets add “John Doe” to the list:

A screenshot of a computer

AI-generated content may be incorrect.

John Doe is now in our list:

A screenshot of a computer

AI-generated content may be incorrect.


Lets Delete John Doe by Clicking on the “Pencil” Icon on the left.

A screenshot of a computer

AI-generated content may be incorrect.

Notice that there is a “Delete” and a “Apply Changes” button.

Lets “Delete” John Doe. When we press the “Delete” button we get a confirmation message:

A screenshot of a computer

AI-generated content may be incorrect.

Press “ Delete” and “John Doe” disappears from the list.

A screenshot of a computer

AI-generated content may be incorrect.


Conclusion
Customizing column display names in Oracle APEX is a simple yet powerful way to enhance the clarity of your reports. By renaming headings, you help users understand the data at a glance, making the application more intuitive and professional. Whether you're adjusting a Classic Report, Interactive Report, or Interactive Grid, taking the time to align column labels with user expectations improves both usability and readability.

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...