X

Break New Ground

  • June 16, 2020

Get Started with APEX

This is a syndicated post, view the original post here

Oracle Cloud offers users low-code development tools such as Oracle Application Express (APEX) to quickly build professional data-driven web applications. APEX lets you build and deploy these applications right from your browser - no additional tools required. The resulting applications provide a modern user experience that works in virtually any mobile or desktop browser.

APEX Overview

APEX starts with your most valuable asset: data. It combines your data models with the unique capabilities offered by Oracle Database, fully leveraging the database to manage session state, resolve application logic, compose the user experience, and instantly deliver web apps to end-users. Because your database does the heavy lifting typically reserved for application server clusters, your middle tier becomes highly streamlined. This eliminates almost all mid-tier complexity and cumbersome resource demands. The database provides fast performance, scalability, and high availability, which allows you to increase the number of apps and end-users.

Unlike traditional three-tier apps that rely on ever-changing development frameworks and methodologies, APEX preserves your investment in apps for many years without requiring code changes. Your apps automatically receive new features and UI design enhancements when regular updates are applied to the database and to APEX.

To get the most out of APEX low-code development, it is recommended that you have beginner-level familiarity with databases and SQL. This is not a strict requirement, but it helps. If you have not heard of SQL and never want anything to do with a database, then stop here. If you like SQL or at least you think it sounds interesting, then you are going to love APEX.

Another benefit of APEX is that it is well documented and commonly used. If you want to drill into details, you can find numerous videos and tutorials and a large and thriving community of low-code developers and partners. You can personally meet APEX enthusiasts at conferences, virtual events, and meet-ups across the globe. In other words, there are plenty of places to go for further details, tips, and best practices. Although the basics of APEX are very straightforward, it is nice to know you have access to a wealth of supplemental information if needed.

Note: Much of the large body of knowledge about APEX comes from the fact that it has been around for nearly two decades. APEX got its start in 2000. It was known as HTML DB in early years. It has been steadily growing and evolving ever since.

One last point... APEX is free! You can install APEX on a free or paid version of Oracle Database and run as many apps and end-users as you like. In Oracle Cloud, APEX comes bundled with Oracle Autonomous Database (ADB), a fully managed cloud database service that is popular with developers. With the new Always Free version of ADB available in Oracle Cloud Free Tier, you get a dedicated cloud database with APEX pre-installed plus a streamlined middle tier.

Getting Started

First, we will be running APEX on ADB for this tutorial, so start by following Todd Sharp's excellent blog post about signing up for an Oracle Cloud Free Tier account and creating your first Always Free database. I will not repeat all of that information here.

Let’s jump in specifically with APEX. In the details screen of your database, click the Tools tab. Notice a prominent box that says Oracle Application Express. Click Open APEX in this box, which opens APEX in a new browser tab. You might need to wait an extra minute for APEX to finish opening the very first time (subsequent loads are faster).

On first use of APEX, you are prompted to sign in to the Administration Services console as a database administrator and create an APEX workspace to start with. APEX Administration Services is where you go to create and manage APEX workspaces, user accounts, and more. Sign in using the database administrator password you entered when creating your ADB instance.

Soon you will see an APEX Administration Services welcome screen that looks like the one below. Review the message text, and click the button to proceed.

Next, you are prompted for an APEX workspace name, a database user name, and a password. This new workspace will be your shared work area where one or more low-code developers can build and run APEX applications. After you finish this step, an APEX workspace, a database user, and a database schema (with same name as your database user) will be automatically created. Later, when we create an APEX app, it will run against database objects in your schema.

For our example, enter DEMO as the database user name and workspace name. Make sure to remember your password. Click the Create Workspace button to continue.

Here you see the APEX Administration Services main page. Notice a message at the top indicating your workspace has been created.

Before you do anything else, bookmark this page in your browser so you have an easy way to open APEX Administration Services in the future with a single click. The bookmark should look something like this:

https://<db-id>.adb.<data-region>.oraclecloudapps.com/ords/apex_admin

Now we are going to sign out of APEX Administration Services and go to the sign-in page for APEX workspaces. In the message at the top of your screen, notice it contains a link with the name of your new APEX workspace (in our example, DEMO). Click this link to continue.

You are signed out of APEX Administration Services and redirected to the APEX workspace sign in page with your workspace name automatically filled in. Enter your workspace password, then click Sign In to continue.

We now see the APEX Workspace homepage. It gives you easy access to the four main areas of APEX: App Builder, SQL Workshop, Team Development, and App Gallery. App Builder is where you go to create and edit APEX apps. SQL Workshop provides a full database object explorer plus an interface to run SQL queries and see query results. Team Development gives you access to the rich collaborative development features of APEX. App Gallery includes a suite of predefined productivity applications you can install and use. For this tutorial, we will work mainly in App Builder.

Bookmark this page in your browser so you have an easy way to sign into your APEX workspace in the future with a single click. The bookmark should looks something like this:

https://<db-id>.adb.<data-region>.oraclecloudapps.com/ords

At this point, you can pause and pat yourself on the back because you’ve finished a major milestone. You have a free instance of APEX running in Oracle Cloud and a shiny new APEX development workspace. Now you’re ready to create your very first APEX app!

About Creating APEX Apps

There are several ways to quickly create APEX apps. You can import spreadsheet-type data from a file, adapt an existing app from the APEX App Gallery, or create an app from scratch. APEX App Builder makes all of these options available in a single wizard. In the interest of time, we’re not going to cover all of the options here. We will focus on creating an app from sample data because it is probably the most common way to kickstart a new APEX app.

The reminder of this tutorial is divided into four distinct sections. In Part 1, we will launch the app creation wizard and load a sample data set. In Part 2, we will finish the wizard and automatically generate an APEX app. In Part 3, we will run the app and sign into it. Lastly, in Part 4, we will explore the app, make two small changes, and then re-run it.

Part 1: Loading Sample Data

  1. From the APEX workspace homepage, click App Builder.

  2. Click Create a New App.

  3. Click From a File.

    When creating an application from a file, APEX allows you to upload CSV, XLSX, XML, or JSON files and then build the app based on this data. Alternatively, you can also copy and paste CSV data or use sample data sets that are included with APEX.

  4. Within the Load Data dialog, click the Copy and Paste option at the top.

  5. Click the dropdown box that shows a list of sample data sets, and select Project and Tasks. Notice a sample data set is automatically pasted for you into the text area below. From here, you can simply click Next.

  6. Review the parsed data. At the bottom of this page is a sampling of actual table data that will be created in the database.

  7. Set Table Name to PROJECT_TASKS and click Load Data to proceed. Note Error Table Name defaults to the same value as Table Name with a postfix of _ERR$. You can ignore the prompt to select individual columns because we will be loading all columns (default behavior).

    After clicking Load Data you will see a spinner until the wizard finishes loading data. Continue to Part 2 at that point.

Part 2: Creating the App

The data loading step has created a new database table and populated it with records from the sample data. Now you can create an APEX app based on this table.

  1. In the final Load Data screen, verify that 73 rows have been loaded into the PROJECT_TASKS table, then click Create Application.

  2. In the Create Application page, review the new app pages that will be generated. Click the Edit button for a given page if you want to review details about it.

    Click Check All next to Features, and then click Create Application.

    When the wizard finishes creating the app, you will be redirected to the new app’s homepage in App Builder.

Part 3: Running the App

  1. Click Run Application. This will open the runtime app in a new browser tab, allowing you to see how end users will view the app.

  2. Enter your user credentials and click Sign In. So far we have created only a single APEX user: the user generated when we created an APEX workspace. Use this same Username and Password now to sign into the app.

  3. Explore the application a little. Click Dashboard (in the home menu or navigation menu) to view charts that were created. Click Project Tasks Search (in the navigation menu) to experiment with faceted searches. Click Project Tasks Report to view an interactive report, then click the Edit icon for a given record to display details in an editable form. Next, navigate to the Calendar page and review the data displayed (you may need to scroll back a few months to see data). Finally, review the options available under Administration.

    Congratulations, you have a live APEX app! This app was generated almost entirely for you by APEX. All you had to do was load pre-packaged sample data and make a few simple settings.

Part 4: Exploring, Changing, and Re-Running the Application

In this final section, you will get first-hand experience enhancing your app. We will improve the app’s faceted search page for better clarity and improved usability.

Start by reviewing the Project Tasks Search page in this app. See that you can check and uncheck various search facets. When you check a facet, the counts on all remaining facets are updated to show the number of records that meet your search criteria. Note the Status facets, which are commonly used to report on project status, are located down the page instead of at the top. Also, users are allowed select multiple values for Status, when most likely they will be reporting only one project status at a time. Let’s improve this user experience a bit.

  1. From the runtime application, go to the search page by clicking Project Tasks Search. Given you ran this app from the App Builder, a special Developer Toolbar is displayed at the bottom of the screen. Note: end users who log directly into the app will not see this toolbar.

    In Developer Toolbar, click Edit Page 3.

    Alternatively, you can also navigate back to App Builder in your browser manually by selecting the appropriate browser tab or window. Once you are in App Builder, click the page 3 - Project Tasks Search.

    You should now be in APEX Page Designer. This is where you will spend the majority of your time improving the application. There are three panes within Page Designer. The left pane displays a hierarchical list of page components called the Rendering Tree. The middle pane displays page Layout (a high-level representation of the rendered page) and Gallery (from which you can drag and drop app components into the Layout). The right pane is the Property Editor, where you can change attributes for a selected component.

  2. Status is a very common search criteria, so you want to reorder facets so that Status is higher up in the page between Project and Assigned To.

    In the Rendering Tree (left pane), under Search, within Facets, click and hold P3_STATUS. Drag it up until it is immediately under P3_PROJECT, then release the mouse.

  3. Currently the Status facet is a series of checkboxes. However, it is unlikely users will want to select more than one status at a time, so you want to convert this into a radio group.

    Continuing with P3_STATUS selected, within the Property Editor (right pane), for Identification > Type, select Radio Group. Scroll down the properties in Property Editor, and for List Entries > Zero Count Entries, select Show Last.

  4. At the top right of the page, click Save and Run Page to save changes made to the facets and review the app.

  5. In the runtime environment, click one of the statuses. See how the counts on other facets are updated based on your selection. Also, notice how you can still select one of the other statuses or click Clear within Status to clear your selection and again show all status counts.

    You have just finished the final part of this tutorial. You implemented a few changes to a live APEX app and then re-ran the app to verify them. Great work!

Conclusion

In closing, I hope this quick tour of APEX low-code app development has been helpful to you. Not a stitch of coding was required to stand up a nice looking, full featured web app in a matter of minutes. We refer to these apps as “data-driven” because not only do they work with business data, but also because, as you have seen, the developer typically starts with data and works upwards to build and deploy the app. This approach can transform anyone who has basic familiarity with databases into a highly productive low-code developer.

To learn more about building low-code, data-driven apps using APEX, head over to apex.oracle.com for further information. You might also want to review the APEX online tutorials available from Oracle on GitHub. These tutorials provide all the information you learned here and much more.

Enjoy using APEX!

Join the discussion

Comments ( 1 )
  • Puratchidasan Tuesday, June 2, 2020
    Simply Superb!!!
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.