Skip to content

Pages and regions ​

Pages ​

A page has a number (unique in the app; 0 is the Global Page), a name, a title, an alias, and these behaviours:

PropertyValuesEffect
modenormal, modalModal pages open in a dialog over the page that linked to them. After a successful submit the dialog closes and the page below reloads (showing the success message), unless the button or branch stays in the dialog (sprint 240), or a branch sends the page below to its target (sprint 249). On phones the dialog is full screen. Opened directly, a modal page works as a normal page
dialog_positioncenter, left, right, top, bottomModal pages: a centred dialog (the default) or a drawer that slides in from that edge (APEX: the Drawer page template; 26.1: top and bottom drawers). See Dialogs and drawers
dialog_sizesmall, medium, largeModal pages: the dialog's or side drawer's width, the height of a top or bottom drawer
parent_pagepage numberBreadcrumb trail, and which menu entry is highlighted
requires_authbooleanfalse makes the page public in an app with a login
authzscheme nameWho may open it (403 otherwise)
protectionchecksum, unrestrictedWhether URL item values need a checksum
warn_unsavedbooleanAsk before the user leaves the page with unsaved changes, see below
helpMarkdown(140; APEX: Page → Help Text) The page's help text, with &ITEM. substitutions; a help_text region shows it. At most 20,000 characters
aliasa-z, 0-9, -(193) /a/<app>/<alias> opens the page; from the name when empty, see Page alias

Page alias ​

(sprint 193, migration 170; APEX: Page → Identification → Alias) A page's alias gives it a readable URL: /a/hr/employees opens the page with alias employees exactly as /a/hr/2 does, through the same sign-in, authorization scheme, page protection and checksums. Links with item values are signed with the page number, so a signed link works under either address: /a/hr/employees-form?P3_EMPNO=7499&cs=… and /a/hr/3?P3_EMPNO=7499&cs=… carry the same checksum. The URLs pgkiln makes itself (menu entries, branches, meta.page_url, links of reports) keep the page number; write the alias where you link by hand.

An alias is lower case letters a–z, digits and single hyphens between them (leave-requests, q3-report), at most 64 characters, not only digits (a number is a page number), unique in the application, and not one of the runtime's own paths of /a/<app>/…: account, autorest, login, logout, notifications, offline, password, push, reports, rest, session, sso, static, tasks, telemetry, tz, workflows, workspace-files. An alias only ever reaches a page of its own application: /a/hr/<alias of another app's page> is Page not found, as is any other text.

Every page has one. A new page takes one from its name (Leave requests → leave-requests; accents dropped, other characters a hyphen); a name that gives nothing usable takes page-<number>, a reserved word gets -page (Login → login-page) and a taken one the next free number (employees-2). Edit it in the Page Designer under Identification → Alias; empty takes one from the name again. Changing an alias changes the page's URL: links to the old alias stop working. Exports carry the alias; an export made before migration 170 imports with aliases from the page names, a copied page gets the next free variant, and an APEX import keeps APEX's page aliases (LEAVE_REQUESTS → leave-requests) where pgkiln can use them. The HR sample's pages have the aliases the migration gave them from their names: /a/hr/dashboard, /a/hr/employees, /a/hr/leave-calendar, …

The Global Page ​

(sprint 229, migration 187; APEX: page 0, page type Global Page) An application can have one page with number 0, the Global Page. Its components are part of every other page of the application: a notification banner, a help or chat drawer, an item every page reads, a dynamic action that runs everywhere, a computation that fills an item before each page is shown. Create page → Global Page makes it (the tile is there while the application has none; a blank page with number 0 is the same); the Page Designer opens it at /builder/apps/<id>/pages/0, and the Pages report shows it with type Global Page and On every page instead of Run.

  • What every page gets: page 0's regions (each in its own display position, ordered by sequence among the page's own: at the same sequence the page's own comes first), items, buttons, dynamic actions, computations, validations and processes. A process or computation of page 0 runs on every page at its point (On load, Before header, On submit, After submit). Branches stay each page's own: one on page 0 never runs (the Advisor says so).
  • Never opened by itself: /a/<app>/0 (and its alias) is Page not found, as is a lazy region or dynamic action requested through page 0. In the Page Designer, Run opens the home page. A link, button or menu entry to page 0 goes nowhere; the Advisor reports it.
  • Who gets it: page 0's Authorization and Page requires sign-in decide whether a user gets its components at all; the page itself still opens. With sign-in required (the default), a public page or the login page shows nothing of it to a user who isn't signed in. Then each component's own authorization scheme, server-side condition and build option apply, as on any page; page 0's build option leaves all of it out. Its other settings (title, mode, protection, template) have no effect, and it is always a normal page (never a modal dialog).
  • Dialogs too: as in APEX, modal pages get the Global Page as well. Keep a region off dialogs with the condition Current page is not a dialog (page_is_not_dialog), or off chosen pages with Current page is not in (page_not_in) or a SQL condition on :APP_PAGE_ID, the page being shown.
  • Items are named P0_… as in APEX (the Advisor notes other names). Their values are session state like any page item's; clearing a page's cache (?clear=1, a branch's Clear cache) keeps them. A page's own item or button of the same name wins over the Global Page's.
  • Lock and comments: a builder lock or developer comment on page 0 is the application's (page 0 has always meant the whole application there): locking the Global Page locks the application, and deleting the Global Page keeps the application's lock and comments.
  • Copies, exports, files: Create page as copy copies the Global Page into another application as its page 0 (or as a normal page, its items renamed P0_ → P<n>_), and a page copied as page 0 becomes a Global Page (a modal page becomes a normal one). Exports, imports, pgkiln export --format text (pages/0000-global-page/…), --only pages/0, working copies and the MCP tool get_page (page 0) carry it like any page. The APEX importer maps APEX's Global Page to page 0 with its components.

The HR sample's Global Page (examples/hr/hr_95_global_page.sql) shows managers a notice in the banner position on every page: how many leave requests wait for a decision (a computation on page 0 counts them into P0_PENDING_LEAVE), with Review (to Leave requests) and Dismiss (two dynamic actions: one sets P0_LEAVE_NOTICE_SEEN on the server, one hides the region). A SQL condition keeps it off Leave requests (6) and Leave request (7).

Warn on unsaved changes ​

With Warn on unsaved changes (Page Designer → Page → Appearance; APEX: the page attribute of the same name), the browser asks "You have unsaved changes. Leave this page anyway?" when the user leaves the page while an item has a value other than the one the page was shown with: a link, a redirect button (such as Cancel), the navigation menu, closing a dialog (its × or Escape), reloading or closing the tab. Submitting the page with a button doesn't ask (that saves). After a submit that failed (a validation error), the values on the page are not saved yet, so leaving asks even without a further change. The check is in the browser (pgkiln.isChanged() tells your own JavaScript, like APEX's apex.page.isChanged()); without JavaScript there is none.

  • Leave an item out with {"warn_unsaved": false} in its attributes (APEX: the item's Warn on Unsaved Changes: Ignore), for example a search field.
  • The interactive grid has its own check of unsaved rows, which is always on.
  • A value a dynamic action changes on page load counts as a change.
  • The create page wizards switch it on for the form pages they make; existing pages have it off until you switch it on.

Minimal pages ​

Page template Minimal (no navigation) (Page Designer → Page → Appearance; APEX: the page template of the same name) shows the page without the header, the navigation menu and the navigation bar: the title and the regions only, centred. The application's login page uses it and gets the sign-in page's backdrop.

Pages without navigation ​

Page template Standard without navigation (no_navigation in the files; sprint 241) is the Standard page without its header, navigation menu and title bar, for a page that is a screen of its own: a kiosk, a form opened from a link in an e-mail, a page shown in another site's frame. Unlike Minimal (made for sign-in pages) it stays an application page: the progressive web app (manifest, service worker, offline queue), push notifications, live badges, the footer with the application's version and the developer toolbar all remain. The page's title is its <h1> for screen readers only; breadcrumb regions and regions in the banner position still show. On a modal page it changes nothing (a dialog has no header or menu), which the Advisor says. HR page 68 Visitor sign-in uses it (HR part 104).

Side columns and display positions ​

Like APEX's Universal Theme, a page has display positions and a region chooses one with its Position (Page Designer → region → Layout; position in the files; APEX: Layout → Position):

positionWhere the region shows
bannerAt the top of the page content, above everything else
after_logoIn the header, right after the application's name (APEX: After Logo)
before_navigation_barIn the header, before the navigation bar list, the bell and the user menu (APEX: Before Navigation Bar)
after_navigation_barIn the header, at its end, after the user menu (APEX: After Navigation Bar)
top_navigationA bar under the header, over the whole width of the window (APEX: Top Navigation)
breadcrumbIn the bar under the title (the place of APEX's Breadcrumb Bar)
full_widthUnder the breadcrumb bar, over the whole width of the content, with no side column beside it (APEX: Full Width Content)
left, rightIn the side column of a page with page template Left side column or Right side column
body (or empty)The page body, on the 12-column grid (the default)
footerAfter the body
dialogsAfter the footer: the place for inline dialogs and drawers, which open over the page (APEX: Dialogs, Drawers and Popups)

(sprint 234, AX-12) The positions are listed in the order of APEX's Slot list, which is also the order of the Page Designer's layout and rendering tree. The header's positions (after_logo, before_navigation_bar, after_navigation_bar) and top_navigation belong to the page templates with the application's header — Standard and the side-column templates. A Minimal page and a page opened as a modal dialog have no header: a region placed there is left out (as in APEX), the Page Designer draws such a position only while it holds regions (marked not in this page template: not shown), and the Advisor warns about it. A region on the Global Page in a header position shows in the header of every page that has one.

In the header a region is one line high and flat: its title and frame are left out (give it the plain template), paragraphs and lists show on one line, and what doesn't fit is cut off rather than widening the bar. On a phone (under 640px) the header keeps only After logo; Before and After navigation bar are hidden there. A list in a top_navigation region shows as a row of links. The header and the top navigation bar are outside the page's form: use them for static content, links and lists; items and submit buttons there send nothing when the page is submitted (the Advisor warns), so keep those in the body. full_width and dialogs regions are inside the form like the body's. The HR example's page 70 Page positions (examples/hr/hr_106_page_positions.sql) has a region in each.

The page templates Left side column and Right side column (Page Designer → Page → Appearance; page_template left_side_column / right_side_column) put the regions of that position in a column beside the body (14–18rem wide; under the body's start on screens under 900px). On a page without that side column, left and right regions show in the body, in sequence. Regions keep their sequence within a position, and a region its condition leaves out leaves no empty position behind. A faceted search in the left column next to its report is the typical use.

Button positions ​

A region's button has a Button position (Page Designer → button → Layout; slot in the files; APEX: Button Position):

slotWhere the button shows
create, edit, change, copy, help, upIn the region's header, after the title
previous, close, deleteAt the left end of the region's bottom bar
nextAt the right end of the bottom bar, after every other button there
region (or empty)With the region's other buttons, as before: the header of reports and charts, the bottom of forms and static content (in the bottom bar, before next)

Positions apply to the standard, collapsible, plain, tabs_container and flex_container templates (so also to sub regions with them); the other templates place every button where they always do. Page-level buttons have no position.

Dialogs and drawers ​

A modal page (Page Designer → Page → Appearance: Page mode Modal dialog) opens over the page that linked to it. Dialog position chooses how:

PositionOpens asSizes (small / medium / large)
Centred dialogA dialog in the middle of the screen480 / 760 / 1100 px wide
Drawer from the right or leftA full-height panel docked to that edge, sliding in400 / 560 / 860 px wide
Drawer from the top or bottomA full-width panel docked to that edgeabout a third, half or most of the screen high

On phones centred dialogs and side drawers fill the screen; top and bottom drawers keep their height. Users who prefer reduced motion get no slide-in animation. Everything else (closing after a submit, the Dialog Closed dynamic action, opening the page directly as a normal page) works the same for every position. In the HR example, Leave request (page 7) is a drawer from the right.

(sprint 249) A branch of the dialog page with In the page below closes the dialog and sends the page below to another page with items (Find an employee, HR page 76, opens the profile it found): see A dialog that sends the page below elsewhere.

Layout ​

The page content is a 12-column grid. Each region's columns (1–12) sets its width on desktops. On tablets, regions of 6 columns or less pair up (two per row) and wider ones take the full width; on phones every region takes the full width.

Region templates:

templateAppearance
standardA card with a header (title and buttons) and a body
plainNo frame and no header: content only (good for KPI cards and intro text)
collapsibleA standard card whose body can be collapsed by clicking the header; its header buttons stay visible while it is collapsed
heroA large banner: an icon ({"icon": "users"} in the attributes), the title, the text and the buttons (APEX: Hero)
title_barThe title and buttons on one line over the content, without a card (APEX: Title Bar)
buttons_containerThe buttons only (after any text), without a header (APEX: Buttons Container)
inline_dialogHidden until opened, then a dialog over the page with a close button; Esc and a click beside it close it too (APEX: Inline Dialog)
inline_drawerThe same, as a panel docked to the right edge (APEX: Inline Drawer)
wizardA narrow, centred card for one step of a wizard; a list region with template wizard_progress above it shows the steps (APEX: Wizard Container)
tabs_container(sprint 195) A card whose sub regions are tabs: one tab per sub region, its title as the tab's label (APEX: Tabs Container)
flex_container(sprint 195) No frame: its sub regions side by side, as many as fit, wrapping to one under the other on narrow screens (APEX: the gallery's Flex Container)

An inline dialog or drawer opens with the dynamic action Open region (and closes with Close region), e.g. on the click of a button with action Defined by dynamic action, or with a link to #R<id> (which also works without JavaScript). Items in it are part of the page: a submit sends them along.

(sprint 238) Give the region a static ID and it opens by that name, which an exported file keeps (a region's id changes on import):

  • a link to #<static id> (in static content, a list entry's URL) opens it; a list entry's link becomes #R<id> on the page that has the region, so it works without JavaScript too;
  • a button with action redirect and Open inline dialog (target_region) set to the static ID opens it on this page (a link to #R<id>), or, with a target page, on that page once it shows;
  • a process with Then open inline dialog (open_region) opens it on the page that comes back after a submit in which the process ran: "Save and add another" (the process clears the item and the dialog is there again);
  • a branch with Open inline dialog (open_region) opens it on its target page; a branch's wins over a process's;
  • a submit that fails (a validation, a process error) from a button inside an inline dialog, or with an error on an item or grid inside one, shows the page again with that dialog open and the error in it.

The page that comes back renders the dialog with open (shown without JavaScript too) and app.js shows it as a modal dialog. Not after a submit that closes a modal page: the page below may not reload. The Advisor warns when no inline dialog or drawer region of that page has the static ID. HR's page 66 (Row links) opens its Department note dialog in each of these ways. (sprint 219; APEX 26.1: the inline drawer's footer) A sub region of an inline dialog or drawer with position footer shows in its footer, before its buttons: the header and the footer stay in place while the body scrolls (a total, a short note, a link). HR's page 44 has one in its Help drawer. The carousel is a style of the display selector region ({"style": "carousel"}). The HR example's page 44 (Region templates) shows them all.

(sprint 230) A region can also start a new row or a given column of the grid, and have its own classes: see region properties.

Every region also has seq (order), a server-side condition (condition_type, condition as its expression, condition_value; without a type condition is a SQL boolean expression; the region renders only when it holds) and authz (an authorization scheme).

Sub regions ​

(sprint 195; APEX: Sub Regions, Parent Region) A region can sit inside another region of its page: set its Parent region (Page Designer → region → Layout; parent_id in the meta.region row, parent in the exported files), or drop it into the region's Sub regions slot in the Page Designer. Nesting is one level deep: a sub region holds no regions, and a region with sub regions can't go inside another. The parent's template decides how its sub regions show:

Parent's templateIts sub regions
tabs_containerOne tab per sub region, labelled with the sub region's title, one shown at a time. The tabs follow the ARIA tabs pattern: Tab reaches the current tab, the arrow keys, Home and End move between them; the tab chosen is remembered for the browser session, and a link to #R<id> of a sub region opens its tab. On a phone the tabs scroll sideways. Without JavaScript the tabs are links to the sub regions, which all show
flex_containerSide by side, each at least about 16 rem wide, wrapping to one under the other on a phone; their column span is not used
collapsibleIn the region's body, under its own content: they collapse with it
any otherOn a 12-column grid of their own under the region's own content, by their column span (two per row on tablets, one on phones, as on the page)

A sub region is an ordinary region with its own type, template, source, items, buttons (and their button positions), caching and lazy loading. Give the sub regions of a tabs container the plain template: the tab already shows their title (without JavaScript a plain sub region gets its title as a heading over its panel). A sub region's own display position is not used: it shows where its parent does.

  • The parent decides first. A sub region shows only where its parent shows: the parent's authorization, server-side condition and build option apply to its sub regions too, and with them to their items and buttons (a button or item of a sub region that isn't shown can't be pressed or set by a forged request). A sub region's own authorization and condition apply as well: a sub region of a tabs container that isn't shown leaves no tab behind.
  • Partial refresh. A dynamic action Refresh region on a sub region renders only that region; it is replaced inside its tab or grid, which keeps its state (the tab stays open). A refreshed parent renders its sub regions with it.
  • Deleting a region with sub regions in the Page Designer keeps them: they move up to the page, into the deleted region's display position and place, in their order. A region deleted by SQL leaves its sub regions at page level too (on delete set null), in their own position.
  • Export and import keep the tree (meta.export_app / meta.import_app, the directory files, Copy page, Duplicate and Copy to other page, which copy a container with its sub regions). A parent that is missing from a file leaves the region at page level.

The HR example's page 53 (Department overview) has a tabs container with a report (with a Refresh button that refreshes only it), a form (its Save at the end of the bottom bar) and a chart, a tab for administrators only, a flexbox container with three key figures and a collapsible region with two sub regions; the containers are shown once a department is chosen (their condition applies to all their sub regions).

Region properties ​

(sprint 230, migration 188; APEX: the region's property groups in the Page Designer) The property editor shows a region's properties in APEX's groups and order: Identification, Source, Layout, Appearance, Accessibility, Advanced, Header and footer, Server-side condition, Read only, Security, Server cache, Customization, Configuration (the build option), Comments and Audit information; the region type's own settings are on the Attributes tab. Every property has help in the editor; the names follow the builder's language. In SQL they are columns of meta.region (all optional: an export made before 0.111 imports unchanged).

GroupProperty (column)On the page
LayoutSlot (position)Where the region shows (see side columns and display positions)
LayoutStart new row (new_row)The region begins a new row of the 12-column grid (otherwise it goes beside the one before while they fit)
LayoutColumn (grid_column, 1–12; empty: Automatic)The column it starts in: 4 leaves three empty columns before it; two regions of 4 columns, the second starting in column 9, have a gap between them. A span that would run past column 12 is cut to fit
LayoutColumn span (columns)Its width in columns
LayoutRow CSS classes (row_css_classes)With Start new row: the row becomes an element of its own, <div class="t-row …">, holding this region and the ones after it up to the next region that starts a new row
LayoutColumn CSS classes, Column attributes (column_css_classes, column_attributes)On the region's grid column: in pgkiln's grid that is the region's element itself
AppearanceTemplate, Template options(moved here from Layout, as in APEX)
AppearanceCSS classes (css_classes)Your own classes on the region (letters, digits, _ and -)
AppearanceIcon (icon)Before the title (standard, collapsible, title bar, inline dialog and drawer) and as the hero template's icon
AppearanceRender components (render_components: above / below)The region's items above or below its content (static content, a chart, a map …); below by default
AccessibilityUse landmark (use_landmark)Off: the region is no landmark (no accessible name)
AccessibilityLandmark type (landmark_type)Its ARIA role: navigation, search, complementary, banner, contentinfo, main or region
AccessibilityLandmark label (landmark_label)Its accessible name (aria-label) instead of the title; &ITEM. substitutions
AdvancedHTML DOM ID (dom_id)The id of the region's content (<div class="region-content" id="…">). The region's own element keeps id="R<id>", which pgkiln's scripts use, and data-static-id
AdvancedCustom attributes (custom_attributes)name="value" pairs on the region's element: data-*, aria-* (not aria-label, aria-labelledby or aria-hidden), title, lang, dir, tabindex and translate. Values may use &ITEM. (escaped). Event handlers (on…), style, id, class, role and URL attributes are refused by the builder and never written into the page
AdvancedRegion display selectorThe region is a tab of the page's display selector ({"display_selector": true} or a tab name in its settings)
AdvancedExclude title from translation (title_no_translate)The title stays as it is in every language and is not offered for translation
Header and footerHeader text, Footer text (header_text, footer_text)HTML above and below the content, like static content: &ITEM. substitutions are escaped, shortcuts expanded, translated with the application
Read onlyType, expression, value (readonly_type, readonly_expr, readonly_value)A server-side condition: while it holds, the items of the region and of its sub regions are read-only (a submit can't change them) and an interactive grid in it has no Save. A broken SQL condition counts as read-only
Server cacheCachingShown here; set on the Attributes tab (see region caching)
CustomizationCustomization (customization: shown / hidden), Customized option name (customization_name)A signed-in user may show or hide the region with the page's Customize link (under the page): it lists the customizable regions the user may see, shown or hidden until the user chooses. The choice is a user preference (PGKILN_REGIONS_P<page>); the public user sees the defaults
CommentsComments (comments)Notes for developers, not shown
Audit informationCreated on / by, Last updated on / byRead-only. Kept by the builder in meta.region_audit (not exported; import --replace keeps a region's creation)

The HR example's page 57 (Region layout, under Administration) uses them: a row with its own classes, a region with a gap before it and one starting in column 4, icons, items above their text, a navigation landmark, an HTML DOM ID, custom attributes, header and footer text, notes that are read-only in View mode, two customizable regions and a title kept in Dutch.

Template options ​

Like APEX's Template Options, regions, buttons and items have Template options (Page Designer, group Appearance): checkboxes for CSS classes from a fixed list per component type, kept in the component's template_options column (text[]) and added to its class. Only classes from the list are written into the page; anything else (an older export, a hand edit) is ignored. The styles are in public/app.css, and follow the app's style variant (accent colour, corners).

Region optionClassEffect
Accent top borderto-accentA 3 px top border in the accent colour
Flatto-flatNo shadow
No border or backgroundto-borderlessTransparent, no border or shadow
Compactto-compactLess padding in header and body
No body paddingto-no-paddingThe body content touches the frame (tables, maps)
Scroll the bodyto-scrollThe body is at most 24 rem high and scrolls
Stretch to the row heightto-stretchRegions side by side get the same height
Centre the textto-centerBody text centred
Hide the headerto-hide-headerThe header is hidden visually but kept for screen readers (standard template)
Button optionClassEffect
Small / Largeto-small, to-largeSmaller or larger button
Full widthto-blockThe button takes the full width
Pillto-pillRounded ends
Outlineto-outlineTransparent with an accent-coloured border and text
Looks like a linkto-linkNo frame, underlined accent text
Success / Dangerto-success, to-dangerGreen or red button
Item optionClassEffect
Stretchto-stretchThe item takes the whole row of the form grid
Large fieldto-largeA larger field and text
Quietto-quietNo border or background until the field has the focus
Bold valueto-boldThe value in bold (also for display items)
Hide the labelto-hide-labelThe label is hidden visually but kept for screen readers

Report columns get a Display choice in the region's Report settings (one per column): Bold (to-col-bold), Muted, No wrapping, Monospace, Right-aligned or Centred, kept in the region's config as "column_options": {"name": ["to-col-mono"]} and only taken from that list.

In SQL: update meta.region set template_options = '{to-accent,to-compact}' where id = 12; The database only checks the shape (at most 12 names of lower case letters, digits and -).

Notifications and live badges ​

Sprint 165 (APEX: a notification bell in the header, navigation menu badges, badges refreshed by dynamic actions). Two settings under Settings → User Interface → Notifications:

  • Notification bell in the header. Signed-in users get a bell next to their user menu: the number of their unread notifications and the newest eight. Opening one marks it read and goes to its page; Mark all read marks them all; All notifications is the page /a/<alias>/notifications (the newest 100). Application code adds notifications with meta.notify(user, title, body, page, items, icon, push) or a send_notification process:

    sql
    -- in a process after an order is submitted for approval
    select meta.notify(:P5_APPROVER, 'Order ' || :P5_ID || ' needs your approval',
                       :P5_CUSTOMER || ', ' || :P5_TOTAL, 5, jsonb_build_object('P5_ID', :P5_ID), 'shopping-cart');

    The link is signed for the recipient, like a push notification's; push => true also sends it to the user's devices when the application has push notifications on. Titles and texts are escaped. A user keeps the newest 500 notifications; read ones go after 90 days. Notifications are installation data: they are not part of the application's export.

  • Live badges (seconds). Every so many seconds (10 to 3600) an open page asks the server for its badges again and updates them in place, without a reload: the list entries of the navigation menu and bar (a badge, a badge query or a query list's badge column), buttons with a badge query and the bell. Not while the tab is hidden (at once when it shows again, and at once when a push notification arrives); these requests don't count as activity, so an idle session still ends; a signed-out session or a page the user may no longer open stops them. Empty badges are hidden placeholders the refresh can fill.

A navigation bar entry with the unread count is a static list entry with the badge query select nullif(meta.unread_notifications(), 0). To refresh a region (a report of open orders, say) on an interval, use a dynamic action with the timer event and refresh_region. For a list of your own, meta.my_notifications is the current user's notifications (id, title, body, url, icon, created_at, read_at, unread).

Region types ​

TypePurpose
reportRead-only table from a SELECT, with search, filters, sorting, control break, aggregates, highlights, computed columns, group by, pivot and chart views, row selection, saved reports, paging and CSV/Excel/PDF download
classic_report(140) A report without the Actions menu and the interactive features: a table, value/attribute pairs, a badge list or a media list, with a choice of pagination
gridEditable table on one database table, with aggregates, frozen, movable and resizable columns, saved grid reports, a row actions menu, master-detail, copy/paste of cells, and single row, group by and chart views
formFields for one row of a table, with automatic fetch and save
chartBar, column, stacked, line, area, combo, scatter, bubble, donut, pie, gauge, funnel, radar, Gantt, pyramid, polar, range, box plot, stock, treemap, sunburst or timeline chart from a SELECT, with drill-down links
cardsCards or KPI tiles from a SELECT
calendarMonth, week, day and list views of dated rows, with create on click and drag and drop
facetsCheckbox, range and star filters with counts and a search field for a report
smart_filtersOne search field with filter chips and suggestions for a report
display_selectorTabs or a select list that show one region (or group of regions) of the page at a time
mapPlaces (markers) and shapes on an interactive map
treeRows with a parent as an expandable tree
listA list (Shared Components → Lists) as nested links, a badge list, cards or tabs
data_reporterBusiness users build, save and share their own reports from tables and views the developer offers
json_form(sprint 246) A form drawn from a JSON schema a SELECT returns: its answers post as one JSON value into an item, checked against the schema on the server
ai_assistantA chat with an AI service (Claude, OpenAI, Gemini or an OpenAI-compatible service), with context from queries and tools the model may call (an AI agent)
template_componentEach row (or all rows) of a SELECT through a template component: badges, contact cards, timelines, your own
tasksTask list: approvals and actions for the signed-in user
workflowsWorkflow console: the workflows the user started or administers
searchOne search field over several sources (search configurations), results grouped per source
urlAnother site's page (or a page of this server) in a sandboxed frame
loginThe sign-in form of the application's own login page: identity providers, user name and password, Keep me signed in, Forgot password?; see chapter 8. The cursor starts in the user name field; (167) {"autofocus": false} leaves it where the page puts it (a login region lower on a page that has other content)
breadcrumb(140) The page's breadcrumb trail, for the Breadcrumb bar position
help_text(140) The page's help text
staticFixed HTML with &ITEM. substitutions
dynamicHTML produced by a SELECT

(167) Items can be placed in any region. Reports, forms and static content place them themselves; in the other types (a tree, chart, map, cards, calendar …) they show under the region's content, as in APEX; (sprint 240) in an interactive grid they stand in its toolbar, before the search (a file item next to the rows it imports, say). A login region's fields post to a form of their own, so items placed in it are not shown: put them in a region next to it.

Region-specific options go in the region's attributes (config, a JSON object). In the Page Designer the region's Attributes tab has fields for the common ones; (sprint 202) Utilities → Show as JSON shows and edits every key, also those without a field (chapter 3). (sprint 205) The columns of a report, grid, cards or calendar region are also nodes of the Page Designer's tree, each with its own properties (heading, format mask, display, link, …), saved into the same keys.

Static ID (APEX: Static ID, optional): lower case letters, digits, _ and -, starting with a letter, unique on the page. It names the region in exported files, so renaming the region keeps its file and the references to it, and the page renders it as data-static-id on the region (<section id="R12" data-static-id="staff-list">), for your CSS ([data-static-id="staff-list"]) and JavaScript. The element's id stays R<id>.


Regions on a REST data source ​

Every region type that reads a query (report, grid without saving, chart, cards, calendar, map, tree, template component) can read a REST data source instead of a table: set the region's REST data source property. Its Source is then optional SQL over a CTE named rest (select * from rest where …), and parameters go into {"rest_params": {"city": "&P1_CITY."}} in the attributes. See chapter 19.

report (interactive report) ​

Source: any SELECT. Bind variables filter it:

sql
select e.empno, e.ename, e.job, d.dname as department, e.sal
  from hr.emp e left join hr.dept d using (deptno)
 where :P2_DEPTNO is null or e.deptno = :P2_DEPTNO::int

Features for end users:

  • Search across all columns, or in one column chosen under the magnifier at the start of the search field (it shows the column's name once one is chosen); Enter searches (without JavaScript, a Go button) (Enter searches; Go too).
  • Column heading menu (sprint 76; with JavaScript): clicking a heading opens a menu with Sort ascending, Sort descending, Hide column, Control break and the column's values with their counts (with the current search and filters; at most 200), with a box to narrow them; choosing a value filters the report on it. The sort arrow of the sorted column sorts at once. Without JavaScript a heading sorts (again for descending).
  • Hidden columns: hidden from the heading menu or Actions → Columns, shown as chips to bring them back.
  • Column order (sprint 143; APEX 26.2: drag-and-drop columns): Actions → Columns lists the columns in their order with a checkbox to hide each; drag one to another place, or move it with its ↑ / ↓ buttons (each move is announced to screen readers; without JavaScript the buttons submit the dialog). Own column order is a chip that puts the report's order back. The order is kept in saved reports (r12_o=sal&r12_o=ename, the columns it names first, the rest after them in the report's order), and the CSV, Excel and PDF downloads follow it and leave out the columns the user hid.
  • Pagination: 1–15 of 107, first, previous, next and last page, and the rows per page list.
  • Actions menu (sprint 76: a short menu like APEX's; each entry opens a dialog, or unfolds in place without JavaScript): Columns, Filter, Data (sort, aggregate, compute, control break), Format (highlight, rows per page), Chart, Group by, Pivot, Report (saved reports, reset) and Download (CSV, Excel, PDF, print):
    • column filters (=, ≠, contains, does not contain, >, ≥, <, ≤, is empty, is not empty, and since sprint 143 the 26.2 operators below) and sort:

      • is one of / is not one of (APEX 26.2: multi-select filters): tick values in the column's list (with their counts and a search box, as in the heading menu), or type them separated by commas. Is not one of keeps the rows without a value. In the URL the values are a JSON array: r12_f=job|in|["CLERK","ANALYST"] (job|in|CLERK, ANALYST works too), at most 100 values;
      • is between (date-range filters): two values, both included, either may stay empty (Salary ≥ 1000). On a date or timestamp column the fields get the date picker and take dates in the application's date format, and the last day counts as a whole (hiredate|between|["1981-01-01","1981-12-31"]);
      • is in a period, on a date column: today, yesterday, the last 7 days, the last 30 days, the next 7 days, this month, last month, this year or last year (hiredate|period|last_30_days). A period is computed from today when the report runs, so a saved report stays current.

      The dialog shows only the fields the chosen operator needs (without JavaScript it shows all of them); a filter is a chip in words (Job is one of CLERK, ANALYST), also in the PDF's filter list. Ask in your own words and an AI service may use the same operators; a highlight takes the one-value operators;

    • control break: group the rows by a column, with a heading row per group;

    • aggregates: sum, average, count, minimum or maximum of a column, over all filtered rows (not just the page). A Total row closes the table, and with a control break every group gets a Subtotal;

    • highlight: color the rows that match a condition (yellow, green, red, blue or gray; the first matching rule wins);

    • compute: add a column calculated from others, e.g. Year pay = sal * 12 (see computed columns); it can be filtered, sorted, aggregated and highlighted like any column;

    • group by: up to three columns, with the number of rows and any sums, averages, counts, minimums or maximums per group;

    • pivot: one column's values as columns (up to 30), with a function of a value column in the cells and a total per row, e.g. salary per department × job;

    • chart: a bar, column, line, area, donut or pie chart of a function per label column (up to 50 labels), with its data table. The chart view has one series, so the stacked, combo and scatter kinds are only available in a chart region;

    • saved reports: save the current search, filters, sort, break, aggregates, highlights, computed columns and views under a name, and switch between saved reports (below);

    • rows per page, download CSV / Excel / PDF, print, reset.

  • Active search, filters, break, aggregates, highlights, computed columns and views appear as removable chips (with Ask in your own words, as chips with Edit and Remove under the question box). Once a group by, pivot or chart is set, Report / Group by / Pivot / Chart links switch between the views; all views use the same search, filters and facets.
  • Paging with Previous/Next.
  • On phones every row reflows into a card with labelled values.

The report's state lives in the URL (?r12_q=…&r12_s=3&r12_d=desc&r12_b=job&r12_a=sum|sal&r12_h=sal|gt|green|3000), so it can be bookmarked and shared. Everything the user enters is applied safely: search, filter and highlight values become literals (each value of a list and each bound of a range on its own; a period is one of a fixed list of expressions), columns must exist in the result, operators, aggregate functions, chart types and colors come from fixed lists, sort positions are integers, and computed column expressions are parsed (below), never pasted into SQL.

Ask in your own words (AI interactive reports) ​

An interactive report can take a request in the user's own words (APEX 26.1/26.2: AI interactive reports): "sum of salary by department where job is clerk", "managers hired before 1982, highest salary first", "bonus is 10% of salary". Set "ai_filter": {} in the report's attributes (or Ask in your own words under the report's settings in the page designer); a question box appears above the report.

The answer is never SQL: it becomes the report's own settings, the same ones the Actions menu sets: filters, highlights, a search, a sort, a control break, totals (aggregates), a group by, a pivot, a chart and computed columns. They are listed under the box as chips; each chip has Edit (a small form with its column, operator, value, function, color or expression) and Remove, and Undo returns to the settings before the last change (the last five steps, kept in the session). A new request refines the current settings: a filter on a column replaces that column's filters, a sort, break, group by, pivot or chart replaces the old one, highlights, totals and computed columns are added; "start over" clears them. The chips are buttons of one form, so they work without JavaScript.

Without an AI service pgkiln reads the request itself with a rule-based parser for common phrases (APEX 26.2: works with zero AI). Columns are recognised by name or heading (also without spaces, and verbs such as hired for hiredate); values such as "only clerks" or "in sales" are looked up among the report's own rows (as a query parameter); what isn't understood is said in the message, not guessed. Phrases it understands, in English (always), Dutch and German (when that is the user's language):

RequestBecomes
salary over 3000, salary between 1,000 and 3k, hired before june 1981, hired in 1981, name contains "mi", no commissionfilters (gt, ge + le, lt, a date range, contains, null)
only clerks, not clerks, in sales, activea filter on the column that holds the value
sort by hire date, newest first, highest salary firstthe sort
sum of salary by department, count by department and joba group by with its function
total salary, average salarya totals row
break by departmenta control break
pivot sum of salary by department and joba pivot
pie chart of count by department, chart of salary by joba chart
highlight salary over 4000 in reda highlight
bonus is 10% of salary, yearly = sal * 12a computed column
search for smiththe search
start over, clear allno settings

Dutch (salaris boven 3000, sorteer op datum aflopend, som van salaris per afdeling, alleen klerken, bonus is 10% van salaris) and German (Gehalt über 3000, sortiere nach Datum absteigend, Summe von Gehalt pro Abteilung, nur Angestellte) work the same way; another language adds a phrase table to src/runtime/ir-phrases.ts.

With faceted search or smart filters on the same report (sprint 122; APEX 26.2), a condition that one of their facets can hold sets that facet instead of becoming a report filter, so the facet panel or the smart filter chips show it and the facet counts follow. The facets' selections are chips of the box too (with Remove; the facet region edits them), and Undo and start over include them:

ConditionFacet
only clerks, clerks and analysts (equals)a checkbox facet: its values
not clerks (differs from)a checkbox facet with exclude: the value, excluded
salary between 1000 and 3000, at least 2000, hired in 1981a range facet with custom ranges (custom): from / to
rating at least 4a star facet: 4 stars & up

Anything else (salary over 3000, name contains, a column without a facet) stays a report filter. Only facets of regions the user sees count. A smart filters region can also read its own search field this way ("ask": true, below).

With an AI service ("ai_filter": {"service": "NAME"}, an AI service the application may use), the request goes to the service with the report's shown columns (names, headings and kinds: text, number, date, boolean), its operators and functions and the current settings; the answer is a structured output. When the service is disabled or not allowed for the application, the built-in phrases answer instead. The request and the column names go to the service's provider; logged in the AI usage log with the source nl2ir.

Either way the answer is checked again before it is applied: only the report's shown columns (hidden columns are neither offered nor accepted), operators, functions, chart types and colors from the report's fixed lists, at most five filters, highlights and totals, short values (which become escaped literals or query parameters), and computed expressions that pass the same validator as Actions → Compute (below). A chip edit is checked the same way; a form that names a hidden column, an unknown operator or a chip that isn't there is refused. The report builds the SQL and runs it as the application's role. Signed-in users only, unless "public": true.

KeyMeaning
ai_filter{} for the built-in phrases
ai_filter.serviceAn AI service's name (the built-in phrases when it isn't available)
ai_filter.placeholderThe question box's placeholder
ai_filter.publicAlso for users who are not signed in

Computed columns ​

An expression uses the report's columns by name (case doesn't matter; quote names with spaces as "Total pay"), numbers, text in single quotes, + - * /, || to join text, parentheses and these functions: abs ceil floor round trunc mod power upper lower initcap length trim substr left right replace concat coalesce nullif greatest least. Division returns a decimal number, and x / 0 gives an empty value instead of an error. Up to five per report; an expression that doesn't parse is shown as an error and left out, so the report keeps working.

sal * 12 + coalesce(comm, 0)
upper(ename) || ' (' || job || ')'
round(sal / 12, 2)

Row selection ​

"selection": {"column": "empno", "item": "P2_SELECTED"} puts a checkbox in front of every row (with select all in the header). When the page is submitted, the checked rows' values reach the item, colon separated (7839:7902), like a checkbox group; a process can then work on them:

sql
update hr.emp set active = false
 where empno = any(string_to_array(:P2_SELECTED, ':')::int[]);

The item must be on the same page and is usually hidden; it accepts posted values only because the selection names it. The values come from the browser, so treat them as user input (RLS and your process's own checks apply).

Rows chosen on one page of the report stay chosen on the others: every checked or cleared row is recorded in the item's session state right away (a small request in the background), so paging doesn't lose them, the report shows how many rows are selected, and a submit sends them all (the other pages' rows as hidden values). Without JavaScript only the rows of the page you submit from can be chosen. At most 5000 values; values may not contain :.

Saved reports (like APEX's saved interactive reports) belong to the signed-in user. A region with "public_reports": "ADMIN" lets users who pass that authorization scheme save public reports, which everyone who can see the report can apply; only the owner can delete a report. Saved reports are user data: they stay in meta.saved_report and aren't part of the application export.

Attributes (most of them are also in the page designer's Report settings form):

KeyDefaultMeaning
page_size15Rows per page (the user can change it, up to 500)
paginationX–Y of Z"range": "Rows X–Y" without a total, for large tables (see large tables)
keysetnoneWith "range": columns that make a row unique (e.g. ["id"]); Next/Previous seek instead of using an offset (see large tables)
max_rowsnoneMaximum row count: the report, its total and its downloads read at most this many rows (1 to 1,000,000)
lazyfalseLoad the region after the page shows (see large tables)
cachenoneKeep the rendered region: {"scope": "user" | "session" | "all", "seconds": 300}
column_accessnone(sprint 210) A column's condition and authorization: {"sal": {"authz": "SALES_MANAGER", "condition_type": "never"}}; a column that fails either is left out of the page and every download (also classic report, grid and cards; see the builder)
searchabletrueShow the search box (false: no search, no Actions menu; or use a classic_report)
fulltextnone(sprint 135) A tsvector column of the source that the search box also uses: a row is found when its text contains the search text, or its tsvector matches it (websearch_to_tsquery: stemmed words, "phrases", or, -word). It may be a hidden column (you chose it). Without it, the only tsvector column the user may see is used, if there is one. Not with a search in one column
fulltext_configlanguage's(sprint 135) The text search configuration of that search (english, dutch…, the one the tsvector was made with); by default the application's primary language's, else simple. Only names in pg_ts_config are used
interactivetrueShow the Actions menu (only when searchable)
sortabletrueAllow sorting (false keeps the query's order, e.g. for trees)
mobile"reflow""scroll" keeps a horizontally scrolling table on phones
hidden[]Column names to leave out of the display (they can still be used in links). Users can't search, filter, sort, compute or aggregate on them either, also not by editing the URL
json_columnsnone(sprint 142) Columns read from a json or jsonb column of the source: [{"name": "title", "column": "profile", "path": "title", "type": "text"}]. A path is keys separated by dots, a number picks an array element (skills.0.name); type is text (default), integer, bigint, numeric, boolean, date, timestamp, timestamptz or jsonb, and a value that doesn't read as it is NULL. They are columns like the others (search, filters, sorting, downloads). In the report settings: JSON path columns, name=column:path[:type]; … (chapter 19)
headings{}Column headings, e.g. {"sal": "Salary"}; by default hire_date becomes "Hire Date"
formats{}Format masks per column, e.g. {"sal": "FML999G990D00", "hiredate": "DD-MON-YYYY"} (see number formats)
linknoneMakes one column a link: {"column": "empno", "page": 3, "items": {"P3_EMPNO": "#empno#"}}. #col# is replaced by the row's value; the link carries a checksum and is hidden when the user may not open that page
link_columnsnone(sprint 238) Columns of links or buttons of their own: see link columns and row actions
row_actionsnone(sprint 238) A ⋮ menu per row, as a grid's: {"edit": {"page": 3, "items": {"P3_ID": "#id#"}}, "links": [{"label": "Reviews", "page": 20, "items": {…}}]}
empty"No data found"Text when there are no rows
preformatted[]Columns shown with preserved spaces (e.g. indented trees)
saved_reportstruefalse hides saved reports for this report
public_reportsnoneAuthorization scheme whose users may save public reports
pdfnonePDF layout, columns and widths; see report layouts
selectionnoneRow selection: {"column": "empno", "item": "P2_SELECTED"} (see row selection)

Items placed in a report region appear in its toolbar; that's how filter fields (for example a department select list with submit_on_change) are made.

The CSV and Excel downloads use the current search, filters and sort, grouped by the control break column when there is one (up to DOWNLOAD_MAX_ROWS, default 1,000,000, or the report's max_rows). They are streamed from a database cursor, so the server holds one batch of 1,000 rows at a time. Text cells that start with =, +, - or @ are prefixed with ' in CSV so spreadsheets don't execute them. The PDF uses them too; see downloads and printing. Computed columns are included in the downloads; highlights, aggregates and the group by, pivot and chart views are shown on screen only.

(sprint 238; APEX: link columns, Appsmith's button columns) A report can have several links per row, each in a column of its own, besides the one column link makes a link:

json
{"link_columns": [
  {"label": "Edit #dname#", "heading": "Edit", "page": 5, "items": {"P5_DEPTNO": "#deptno#"}, "style": "icon", "icon": "edit", "position": "start"},
  {"label": "Employees", "page": 2, "items": {"P2_DEPTNO": "#deptno#"}, "style": "button", "icon": "users", "when": "has_staff"},
  {"label": "Overview", "page": 53, "items": {"P53_DEPTNO": "#deptno#"}, "style": "hot"}],
 "row_actions": {"edit": {"page": 5, "items": {"P5_DEPTNO": "#deptno#"}},
                 "links": [{"label": "Employees of #dname#", "page": 2, "items": {"P2_DEPTNO": "#deptno#"}}]}}
KeyMeaning
labelThe link's text; #column# takes the row's value (escaped) and the text is translated like other texts (Text Messages)
page, itemsThe target page and the item values it sets, #column# taking the row's values (also of hidden columns). The values carry a checksum, as link's; the link is left out when the user may not open that page, and opens as a dialog when the page is modal
stylelink (default), button, hot (a primary button), danger, or icon: the icon alone, the label being its accessible name and tooltip
iconAn icon before the label (needed for icon)
headingThe column's heading (default: the label without its #column# parts)
positionend (default): after the report's columns; start: before them
whenA column of the query: the link shows only in rows where it is true (not null, false, empty, N or 0); hide the column with hidden

At most 10 link columns; an entry without a label or a page is left out. row_actions gives each row the grid's ⋮ menu: Edit (with an edit link; its label is optional) and the links, each shown only when the user may open its page. A grid's duplicate and delete don't apply to a report. Link columns and the menu show in the report view (not in group by, pivot or chart, nor in downloads); on a phone each is a labelled line of the row's card. A classic report has them too: in its table, and with the value_pairs and media_list templates as links under each row. The Advisor reports a link to a page that doesn't exist. HR's page 66 (Row links) shows each style, when, the menu and both classic templates.


classic_report (classic report) ​

(sprint 140; APEX: Classic Report) A report from a SELECT without the Actions menu, column heading menus, saved reports, downloads or row selection: the same renderer as the interactive report with those left out, and none of their settings is read from the URL. Users can sort by a column heading ("sortable": false leaves that out) and page; a search field only with "searchable": true. Items placed in the region show above it, as filters for its query.

AttributeDefaultMeaning
report_template"standard"standard: a table (a card per row on phones, "mobile": "scroll" keeps the table); value_pairs: each row as headings and values (APEX: Value Attribute Pairs); badges: the first column as the label and the second as a large value (APEX: Badge List); media_list: a title (column title, else the first) and a text (description, text or body, else the second), the title a link with link
pagination"total"total: rows X–Y of Z; range: rows X–Y without counting them all; none: every row on one page (at most max_rows, 500) and no pager
page_size15Rows per page (the user has no rows-per-page choice)
headings, hidden, formats, link, link_columns, row_actions, empty, max_rows, lazy, cacheAs for report
json
{"report_template": "badges", "pagination": "none"}

grid (interactive grid) ​

An editable table on one table. Required properties: table_name (e.g. hr.dept), pk_column (single-column primary key) and a source SELECT that includes the key column:

sql
select deptno, dname, loc from hr.dept

It is saved by a process of type grid_dml whose region is the grid, which the wizard creates. Without such a process the grid is read-only.

(sprint 240) Items placed in the grid region stand in its toolbar, before the search, and are submitted with the page like any item (HR page 67 has its CSV file item there). On a modal dialog page the grid's Save keeps the dialog open (staying in the dialog).

A grid can also edit the rows of a REST data source (region property REST data source instead of a table; the key column is pk_column or the source's first key column): Save, Add row and Delete then call the source's update, insert and delete operations, and are offered only for the operations the source defines (chapter 19).

End users can edit cells inline, add rows (Add row), tick rows for deletion, search, page, and Save. On save:

  • only changed cells are written (each row posts its original values);
  • new rows with at least one value are inserted; blank ones are ignored;
  • ticked rows are deleted;
  • if any row fails (a constraint, trigger, RLS or a missing required value), nothing is saved and each problem is reported with its row number;
  • the user is warned before leaving the page with unsaved changes.

Which columns are editable: columns of table_name that appear in the SELECT, except the primary key, generated columns, GENERATED ALWAYS identity columns and readonly ones. Other selected columns (e.g. from a join) are shown read-only. Each existing row's key is signed, so a user cannot redirect an update or delete to another row by editing the page.

Attributes:

KeyDefaultMeaning
page_size25Rows per page (max 200)
pagination, max_rowsAs for reports
allowall true{"insert": false, "update": true, "delete": false}
readonly[]Columns that may not be edited
columns{}Per column: {"deptno": {"lov": "LOV:DEPARTMENTS", "required": true}}. lov makes it a select list (any list of values). (167) default and default_sql give a new row's starting value: see New rows' default values. (174) validation and validation_message check a row that is added or changed: see Column validations below
headings, hidden, formatsAs for reports
aggregatesTotals in the footer: {"sal": ["sum", "avg"], "empno": "count"} (sum, avg, count, min, max)
layoutThe default column layout: {"order": ["ename", "sal"], "hidden": ["comm"], "widths": {"ename": 180}, "frozen": 1}
frozen0Shorthand for layout.frozen: the first 1 to 5 shown columns stay in view while the grid scrolls sideways
row_actionsA menu per row: {"edit": {"page": 3, "items": {"P3_EMPNO": "#empno#"}}, "duplicate": true, "delete": true, "links": [{"label": "Reviews", "page": 20, "items": {"P20_EMPNO": "#empno#"}}]}
select_rowMakes it a master grid: {"column": "deptno", "item": "P27_DEPTNO"} (below)
masterMakes it (or a report, chart, cards …) a detail: {"item": "P27_DEPTNO", "column": "deptno"} (below)
actionstruefalse hides the Actions menu (columns, aggregates, saved reports)
saved_reports, public_reportstrue, noneAs for reports
viewsallThe views users may switch to besides the grid: ["row", "group", "chart"]; [] for the grid only

Cell editors follow the column type: number, date, date-time, checkbox (boolean), select list (with lov) or text.

New rows' default values. (167; APEX: a column's Default) A column's default is text with &ITEM. substitutions; default_sql is a SELECT whose first column of the first row is the value (with :BINDS). Both are worked out when the grid is shown, and Add row (and the single row view's new row) starts with them:

json
{"columns": {"deptno":   {"lov": "LOV:DEPARTMENTS", "default": "&P27_DEPTNO."},
             "status":   {"default": "NEW"},
             "hiredate": {"default_sql": "select current_date"}}}

A new row the user left at its default values counts as blank and isn't inserted, like an empty one; change any value and the whole row, defaults included, is inserted. A duplicated row is always inserted. Only columns a new row may set take a default (a detail grid's master column is filled from the master as before). For anything that needs a decision per row, the grid_row_init dynamic action event still runs on each new row.

Column validations. (174; APEX: a validation on an editable region's column) A column's validation is an SQL expression that must be true for every row that is added or changed, with validation_message as its error message. Set them in the region's settings under Column validations, or in the configuration:

json
"columns": {
  "sal":  {"validation": ":SAL is null or :SAL::numeric > 0", "validation_message": "The salary must be more than zero."},
  "comm": {"validation": ":COMM is null or :COMM::numeric <= :SAL::numeric",
           "validation_message": "The commission cannot be more than the salary."}
}

The row's columns are bind variables by their names in upper case (:SAL, :COMM): the values as they would be saved, so what the user typed over what the page showed. They are text, like page items: cast them where the type matters. Page items and the built-in names (:APP_USER, :APP_ID, …) work too; a column never replaces a built-in name. The expression runs as the application's database role in the transaction of the save; false, null or an error fails, so allow an empty value in the expression where a column may stay empty (:SAL is null or …). A row that fails is not saved, and because the save is one process nothing else of it is kept either. The grid comes back with what the user typed: the message stands under the cell (the control is marked invalid for screen readers) and in the notification with its row (Row 3: The salary must be more than zero.). A required column that was emptied is marked in its cell the same way. The message may use &ITEM. substitutions and is translated like the application's other texts; without a message the column's heading is shown. Deleted rows and rows the user did not change are not checked. The HR example checks the salary and the commission in the Staff grid of page 27 (examples/hr/hr_83_grid_validations.sql).

Aggregates are computed in the database over every row of the search, not only the rows on the page, and shown in a footer row under their columns. Besides the developer's (aggregates), users add their own with Actions → Aggregate (kept in the URL as r<id>_a=fn|column, like a report's) and remove them with the × on their chip.

Column layout. Users arrange the grid for themselves: Actions → Columns lists every column with Shown, Position and Width (px), and how many columns are frozen (they stick to the left while the table scrolls sideways; the grid's leading columns, the delete box and the row menu, freeze along). With JavaScript, they can also drag a header to move a column and drag its right edge to resize it; the result is saved at once. A user's layout is kept per grid in meta.saved_report (kind layout; for the public user in the session) and applied whenever they open the page; Reset goes back to the developer's layout. Hidden columns are still part of the grid: their values are posted and saved as they were. The developer's hidden columns never show, whatever the layout.

Saved grid reports work like a report's (Actions → Saved reports): they keep the search, the user's aggregates and the column layout. Applying one makes its layout the user's own. public_reports names the authorization scheme whose users may share a report with everyone.

Row actions. With row_actions, each row gets a ⋮ menu: Edit opens a page with the row's values in its items (#column#; a signed link, shown only when the user may open that page, as a dialog when it is a modal page), Duplicate copies the row into a new, unsaved row, Delete ticks the row's delete box, and links adds more such links. Without JavaScript Duplicate is a link that shows the page again with the copy as a new row.

Master-detail. A master grid with select_row gets a radio-style link in front of each row; choosing one puts the row's column value into the page item item (a hidden item on the page). Regions with "master": {"item": …} are its details: they use the item in their query,

sql
select empno, ename, job, sal from hr.emp where deptno = :P27_DEPTNO::int

and show "Select a row above" until a row is selected. As in APEX, the page opens with the master's first row selected, and a search or filter that leaves the selected row out selects the first row it shows (a region placed above its master still waits for a selection). With JavaScript the details are refreshed in place (GET …/region/:id, no page reload); without, the link reloads the page. The selection is a signed link (bound to the application, page, user, region and value), so a user can only select a row the server showed them; the item is not taken from the URL or a submit otherwise. A detail grid with master.column fills that column with the selected value on its new rows (and never lets users edit it); saving new rows without a selection is refused.

Views (APEX: Single Row View, Group By, Chart). Besides the rows, a grid has three views (r<id>_v=row|group|chart in the URL, kept in saved grid reports); views limits them:

  • Single row view: one row at a time as a form, opened from Actions → Single row view or a row's ⋮ menu. First, Previous, Next and Last move through the rows of the search in the grid's order (r<id>_row=N, the position from 1); Add row opens an empty form (r<id>_row=new). It edits the same fields as the grid and is saved by the same grid_dml process, with the same checks (signed keys, required columns, lists of values); the user is warned before leaving with unsaved changes. Give the query an order by (or sort the grid) so that positions stay the same after a save, as for paging.
  • Group by and Chart: set up in the Actions menu as for an interactive report, over every row of the search. Once set up, a switcher above the grid moves between Grid and these views.

The developer's hidden columns can't be grouped, charted or shown in the single row view. After Save the grid comes back as it was: its search, page, sort and view.

Navigation and edit mode (APEX). With JavaScript an editable cell reads as text, with its column's format mask (2,850.00) or the list's display value, until it is edited: click it, or press Enter or F2 on it, or start typing (which replaces the value). On a cell the arrow keys move to the next cell; while editing, Escape goes back to the cell and Enter moves to the cell below. The control keeps the raw value; Tab moves through the controls as before. On a phone, where the rows are cards, the fields show as fields.

Copy and paste. Click a cell and Shift+click another to select a range; Ctrl+C copies it as tab-separated text (which spreadsheets paste as cells). Ctrl+V pastes such text (from a spreadsheet or another grid) from the focused cell on, adding rows when the grid allows inserts; one value pasted into a selected range fills it, Delete empties the range. Read-only cells are skipped, select lists match a value or its display text. Pasted values are only saved by Save, through the same validation as typed ones.

The HR example's page 27 (Departments and staff) shows all of this: a master grid of departments, a detail grid of their staff (totals, a frozen name column, a row menu) and a detail report.


form ​

A form edits one row of table_name, identified by pk_column, whose value is kept in the item pk_item (usually a hidden item). Every item in the region with a source_column maps to that column.

  • Fetch: when the page is shown and pk_item has a value, the row is read into the items. A row that doesn't exist (or is hidden by RLS) gives "record not found".
  • Save: a process of type form_dml does the DML according to the pressed button (a form on a REST data source calls the source's insert, update and delete operations instead, and fetches its row through the source: chapter 19):
Button nameOperation
CREATE, INSERT, ADDINSERT of the non-empty item values (empty columns get their default); the new key is stored in pk_item
SAVE, UPDATE, APPLY, APPLY_CHANGESUPDATE of all editable mapped items
DELETEDELETE (only validations with when_button DELETE run; required and list checks are skipped)

Typical form buttons (as generated by the wizard): Cancel (redirect), Delete (condition :P3_ID is not null), Apply Changes (same condition) and Create (condition :P3_ID is null).

Lost updates (APEX: Prevent Lost Updates and Lock Row). When the form fetches its row, the page also gets a checksum of the row's form columns (file columns aside). On Save or Delete, form_dml locks the row (SELECT … FOR UPDATE), computes the checksum again and refuses the change when it differs: "Someone else changed this record after you opened it. Reload the page to see the current values, then make your changes again." Nothing is written, and the other user's change is kept. Columns that are not on the form don't count, and the checksum doesn't depend on the user's time zone or date format. The check is on by default; switch it off for one form with {"lost_update": false} in the region's attributes. The checksum is meta.row_version(table, key_column, key, columns), which runs as the application's role (so its grants and row level security apply). A process that changes the same row before form_dml in the same submit makes the check fail: change the row after form_dml, or switch the check off.

The easiest way to get a form is the Report and form wizard, which opens the form as a modal dialog from the report, or the Form wizard for a form page on its own (see Create pages from a table). The Cards, Calendar, Map and Faceted search wizards can add a modal form page too.


chart ​

Source: the first column is the label; each further numeric column is a series, named by its column alias:

sql
select d.dname as department,
       sum(e.sal)  as "Salary",
       sum(e.comm) as "Commission"
  from hr.dept d left join hr.emp e using (deptno)
 group by d.dname order by 1

Attributes:

KeyMeaning
kindbar (default), column, stacked, line, area, combo, scatter, bubble, donut, pie, gauge, funnel, radar, gantt, pyramid, polar, range, boxplot, stock, treemap, sunburst or timeline
linkDrill-down: {"page": 2, "items": {"P2_DEPTNO": "#deptno#"}} makes every data point a link (see below)
gaugeFor gauge: {"min": 0, "max": 120, "warning": 80, "critical": 100, "shape": "bar"} (all optional; shape: dial, bar, circle or led)
format_maskA number format mask for the values in labels, tips and the data table, e.g. "FML999G990" (see number formats)
emptyText when there are no rows
gantt_moveFor gantt with a task_id column: SQL that gives a task new dates, run with :TASK_ID, :NEW_START and :NEW_END (below)
gantt_move_authzWho may drag: an authorization scheme, or MUST_NOT_BE_PUBLIC_USER; empty: everyone who sees the chart
gantt_snapday or hour: the step of a drag; default days, or hours when a task has a time
KindBest forNotes
barranking categories with long labelshorizontal bars, values at the tips
columncomparing a few categories or seriesvalues on the caps for ≤ 12 categories
stackedparts of a total per categoryone column per label with the series stacked on top of each other; negative values stack downwards
line / areachange over timelabel column should be ordered (dates, years)
combotwo measures with one shared labelthe first series is drawn as columns, the other series as lines over them
scatterthe relation between two numbersthe first column must be numeric (the x axis); each further column is a y value. Rows with an empty or non-numeric x are left out. The axes don't have to start at zero
donut / pieparts of a whole (≤ 6 slices)uses the first series; more than 6 slices fold into "Other"; zero and negative values are left out. The donut shows the total in the middle
bubblethree measures per itemlabel, then x, y and size columns; the bubble's area is proportional to the size. The axes don't have to start at zero
gaugeone value against a target, per rowa half dial per row (up to 12) from min (default 0) to max (default: rounded up from the values). With warning and/or critical thresholds each dial shows a status (On target, Warning, Critical) with an icon and a label, and the thresholds as a coloured ring. A warning above critical means low values are bad. (sprint 226; Oracle JET's status meter, circular status meter and LED gauges) "shape": dial (default), bar (a horizontal status meter per row, up to 30, the thresholds as ticks on the track), circle (a full ring) or led (a status light in the status colour with the number inside, no scale); each keeps the status in words with an icon. HR page 24 shows all four (part 94)
funnelstages of a processthe first series, in the query's order (sort it); each stage shows its share of the first stage
radarseveral measures per series, side by sideone axis per row (3 to 12 rows), one polygon per series, all on one scale from zero
gantttasks over timelabel, start, end (dates or timestamps; an empty end, or one equal to the start, is a milestone ◆), then optional columns by name: progress (0 to 100, the filled part of the bar), task_id and depends_on (the ids a task waits for: 3, 3,4 or an array). A time axis in hours, days, weeks, months or years, a dashed line for now (in the session's time zone, like the timestamps the query returns), and elbow lines from the end of each predecessor to the start of the task. Rows without a start are left out
treemapparts of a whole in a hierarchylabel, value, then optional columns by name node_id and parent_id (a node's parent; without node_id the label is the id). Rectangles sized by value (a node's own value plus its children's), squarified; the top level as coloured groups with their children inside. One root with children: its children are the top level. Cycles and unknown parents make roots
sunburstthe same, as ringsLike treemap: the top level as the inner ring, children outwards (up to four rings), the total in the centre and a legend of the top level
timelineevents and periods over timelabel, start, end (an empty end is a point in time), and an optional column named series: a lane per series. Items that overlap in a lane get rows of their own
pyramidlevels of a hierarchy, or two groups compared per bandone series: a triangle cut into segments from the top (the first row) down, each segment's area in proportion to its value (≤ 8; more fold into "Other"). Two series: back-to-back bars (a population pyramid), the first series to the left, both on one scale; negative values count as their size
polarvalues per period or direction (months, weekdays)a polar area chart: one equal sector per row (up to 24) clockwise from 12 o'clock, the radius in proportion to the value on rings from zero; several series share a row's sector
rangea span per category (lowest and highest, from and to)low and high columns (in either order): a floating column from one to the other; each further pair of columns is another range per row (up to four, with a legend). The axis doesn't have to start at zero
boxplotthe spread of values per groupone value column with a row per observation (the label repeats; the statistics are computed per label, in the order the labels first appear, like percentile_cont; empty values are left out), or five columns per row: minimum, first quartile, median, third quartile and maximum. A whisker from minimum to maximum, a box between the quartiles and a line at the median; the data table shows the five statistics (and the tip the number of values)
stockprices over timeopen, high, low and close columns in that order (any names): a candle per row, filled green when it closed at or above its opening and red when below, with a wick from low to high. The axis doesn't have to start at zero
sankeyflows from one stage or place to the next(sprint 220; Oracle JET: Sankey) source, target, value (any names): equal pairs add up, a flow to itself and values of zero or less are left out. A node stands in the column of its longest path from a start (a node with no flow out in the last column), its height its larger side (in or out); ribbons as wide as their value join them. A flow back to an earlier node (a cycle) can't be drawn: the chart says so. The data table lists the flows
nboxitems in a grid of two ratings, e.g. performance against potential(sprint 220; Oracle JET: NBox) label, column, row with whole numbers from 1: a 3 by 3 grid, larger up to 5 when a row asks for it; row 1 at the bottom, cells shaded from low (column 1, row 1) to high. Each label is a chip in its cell, with a count per cell; rows outside the grid are left out. The axes are named after the columns
pictocounts people or things can picture(sprint 220; Oracle JET: Picto Chart) one series: a row of icons per label, each icon a round number of units (1, 2 or 5 times a power of ten, at most 40 icons for the largest value; at least 1 per icon for counts), the last icon filled in part; a key says what one icon stands for

A stacked chart, a combination of columns and a line, and a scatter plot:

sql
-- stacked: one column per department, a segment per job
select d.dname as department,
       count(e.empno) filter (where e.job = 'CLERK')    as "Clerk",
       count(e.empno) filter (where e.job = 'SALESMAN') as "Salesman",
       count(e.empno) filter (where e.job = 'ANALYST')  as "Analyst"
  from hr.dept d left join hr.emp e using (deptno)
 group by d.dname order by 1

-- combo: the budget as columns, the average as a line
select initcap(job) as job, sum(sal) as "Salary budget", round(avg(sal)) as "Average salary"
  from hr.emp group by job order by 2 desc

-- scatter: x = years of service, y = salary
select extract(year from age(current_date, hiredate))::int as "Years of service", sal as "Salary"
  from hr.emp where active order by 1

A bubble chart, gauges, a funnel and a radar (HR page 24 "Planner"):

sql
-- bubble: x = years of service, y = average salary, size = headcount (deptno only for the link)
select d.dname as department,
       round(avg(extract(year from age(current_date, e.hiredate)))::numeric, 1) as "Years of service",
       round(avg(e.sal)) as "Average salary", count(*) as "Employees", d.deptno
  from hr.emp e join hr.dept d using (deptno) group by d.deptno, d.dname

-- gauge, {"gauge": {"max": 120, "warning": 80, "critical": 100}}: one dial per department
select d.dname, round(100.0 * coalesce(sum(e.sal), 0) / 10000) as "Budget used", d.deptno
  from hr.dept d left join hr.emp e on e.deptno = d.deptno group by d.deptno, d.dname

-- funnel: stages in order
select 'Requested' as stage, count(*) as "Requests" from hr.leave_request
union all select 'Approved', count(*) filter (where status = 'APPROVED') from hr.leave_request

-- radar: an axis per job, a polygon per department
select initcap(job) as job,
       count(*) filter (where deptno = 10) as "Accounting",
       count(*) filter (where deptno = 20) as "Research"
  from hr.emp group by job order by 1

Gantt, pyramid, polar, range, box plot and stock charts (HR page 32 "Project plan"):

sql
-- gantt: progress, task_id and depends_on by name; deptno only for the link
select t.name as "Task", t.starts as "Starts", t.ends as "Ends", t.progress,
       t.id as task_id, array_to_string(t.depends_on, ',') as depends_on, t.deptno
  from hr.project_task t order by t.starts, t.id

-- pyramid with two series: back to back per salary band
select b.band as "Salary",
       count(e.empno) filter (where e.deptno = 20) as "Research",
       count(e.empno) filter (where e.deptno = 30) as "Sales"
  from (values (1, '3000+', 3000, null), (2, '2000–2999', 2000, 3000)) b(k, band, lo, hi)
  left join hr.emp e on e.sal >= b.lo and (b.hi is null or e.sal < b.hi)
 group by b.k, b.band order by b.k

-- polar: a sector per month
select to_char(make_date(2000, m, 1), 'Mon') as month, count(e.empno) as "Hires"
  from generate_series(1, 12) m left join hr.emp e on extract(month from e.hiredate) = m
 group by m order by m

-- range: lowest and highest salary per department (deptno only for the link)
select d.dname as "Department", min(e.sal) as "Lowest", max(e.sal) as "Highest", d.deptno
  from hr.dept d join hr.emp e on e.deptno = d.deptno group by d.deptno, d.dname order by d.dname

-- box plot: one row per employee; a box per job
select e.job as "Job", e.sal as "Salary" from hr.emp e where e.active order by e.job

-- stock: open, high, low and close per day
select to_char(day, 'DD Mon') as "Day", open as "Open", high as "High", low as "Low", close as "Close"
  from sales.share_price order by day

A Gantt chart reads dates as their wall clock (a timestamptz in the session's time zone), shows a time only when it is not midnight, and has its own data table (label, start, end, progress, dependencies). Its rows count toward the chart's row limit (max_rows, default 1000).

Dragging tasks on a Gantt chart ​

With gantt_move (builder: Chart settings → Gantt: drag and drop) and a task_id column, users who pass gantt_move_authz change the plan on the chart itself (APEX: the Gantt chart's task dragging):

  • drag a task to move it (start and end by the same number of days or hours);
  • drag the end of a bar (its right edge) to make it longer or shorter; a milestone only moves;
  • with the keyboard: focus a task, the arrow keys move it, Shift and the arrow keys change its end, Enter saves, Escape cancels. A line under the chart says the new dates while you drag or press keys.

The server checks the dates (YYYY-MM-DD, or YYYY-MM-DDTHH:MM by the hour; the end not before the start) and that the task is a row the chart's query shows this user, then runs the SQL as the application's database role (row level security applies) and sends the chart back. A milestone gets the same start and end. A click without a drag still follows the task's drill-down link. Example (HR example part 59):

sql
update hr.project_task
   set starts = :NEW_START::date,
       ends = case when ends is null then null else :NEW_END::date end   -- a milestone keeps no end
 where id = :TASK_ID::int

Up to 8 series; two or more get a legend. When an axis has many labels, only some are shown, and in a narrow chart (a region of a few columns, a phone) every other one of those. Every chart has hover/focus tooltips and a Data table toggle (the accessible alternative). Colours come from a palette checked for colour-vision deficiency, in light and dark mode; the gauge's status colours are reserved for status and always come with an icon and a label. Charts resize with the screen.

With link, every data point is a link to a page, like a report link: #column# in the item values is replaced by the value of the point's row, and #series# by the name of its series (the column alias). The URL carries a checksum, so pages with session state protection accept it, and there are no links when the user may not open the target page.

json
{"kind": "column", "link": {"page": 9, "items": {"P9_DEPTNO": "#deptno#", "P9_JOB": "#series#"}}}

Columns that only the link refers to (here deptno) are not drawn as a series, so the query can return a key next to the label. What links: bars, columns and stacked segments (per series), line and area points, scatter dots and bubbles, gauge dials, funnel stages, radar axis labels, pie and donut slices and their legend entries (not "Other"), Gantt bars and milestones (the whole row: #series# is empty), pyramid segments and bars, polar sectors and their labels, range columns (per pair of series when there are several), boxes (the first row of their label) and candles (the whole row). The marks are for the mouse; from the keyboard the data table has the same links (the labels, or each value when there are several series), and so do the radar and polar labels and the donut and pyramid legends.


cards ​

Source: a SELECT with any of these columns: title, subtitle, body, badge, icon (an icon name). Other columns can be used in the link.

sql
select d.dname as title, initcap(d.loc) as subtitle,
       count(e.empno) || ' employees' as body, d.deptno as badge, 'building' as icon, d.deptno
  from hr.dept d left join hr.emp e using (deptno) group by d.deptno

Attributes:

KeyMeaning
style"metric": KPI tiles with a big value (badge) and a label (title)
link{"page": 5, "items": {"P5_DEPTNO": "#deptno#"}} makes each card a link
emptyText when there are no rows
max_rowsMost cards shown (default 500); when there are more, "Showing the first 500 rows." follows
formatsFormat masks for title, subtitle, body and badge, e.g. {"badge": "FML999G999G990"}

calendar ​

Source: a SELECT with start_date, optional end_date (inclusive, for multi-day events) and title, plus any columns used in the link:

sql
select l.start_date, l.end_date, initcap(e.ename) as title, l.id
  from hr.leave_request l join hr.emp e using (empno)

start_date and end_date can be dates (all-day events) or timestamps (events with a time; a timestamp at midnight without an end time counts as all-day).

Attributes:

KeyMeaning
link{"page": 7, "items": {"P7_ID": "#id#"}}: each event links to a page (the edit link)
viewsThe views users can switch between, from ["month", "week", "day", "list"] (default: all four)
viewThe view shown first (default: the first of views)
day_start, day_endThe hours of the week and day views (default 8 to 18); widened when an event needs it
createCreate on click: {"page": 7, "items": {"P7_START": "#start#", "P7_END": "#end#"}}
moveDrag and drop: SQL that moves an event (see below)
keyThe column that identifies an event for move (default id)
move_authzAn authorization scheme for dragging (default: everyone who sees the calendar)

Views. Month: a grid, Monday first, up to 4 events per day plus "+n more" (a link to that day); phones see an agenda list of the days with events. Week and Day: an "All day" row and a row per hour, each timed event in the hour it starts, with its times; on phones the week view is an agenda list too. List: the month's events per day. The buttons ‹, Today and › move by a month, week or day; Month / Week / Day / List switch views. Everything is a plain link (?r<id>_v=week&r<id>_d=2026-10-05, ?r<id>_m=2026-10 for month and list), so it works without JavaScript and can be bookmarked.

Create on click. With create, every day (month view, "All day" row) and every hour slot has a + link to the page, with #start#, #end# and #date# filled in: 2026-10-05 for a day, 2026-10-05 09:00 and 2026-10-05 10:00 for an hour. The link carries a checksum like every link (so the target page can keep session state protection on); with JavaScript a click anywhere on an empty part of the slot follows it. A date item takes the date; a date-time item shows a day as midnight.

Drag and drop. With move, users drag events with the mouse to another day or hour slot. The browser sends the event's key and the slot; the server checks the CSRF token, the page's and the region's authorization and condition, move_authz, and that the event is in the region's query for this user (as the application's database role, so row level security applies), works out the new start and end (an event keeps its length; a timed event dropped on an hour starts there, else it moves by whole days and keeps its time of day) and runs move as the application's role with three binds:

BindValue
:EVENT_IDthe key column's value
:NEW_START2026-10-07 or 2026-10-07 14:00 (the same form as the old start)
:NEW_ENDthe new end, or NULL when the event has none
json
{"move": "select hr.move_meeting(:EVENT_ID::int, :NEW_START::timestamp, :NEW_END::timestamp)"}

Put your own rules in the function (raise an exception with a message for the user, e.g. "Only the organizer can move this meeting."); the calendar redraws itself after a move and shows the error otherwise. Binds are replaced as literals outside quotes, so call a function rather than using them inside a DO block. Without a mouse (keyboard, touch, no JavaScript), the event's edit link is the way to change its dates.


A panel of filters, each with a live count, that filters a report region on the same page. Counts take the search and all other facets into account. Three kinds of facet:

  • checkbox (the default): the most frequent values of a column, each with a checkbox; after the seventh the rest sit under Show all (n) (open when one of them is chosen), and a boolean's values read Yes and No. Its ⋮ menu (APEX: the facet's menu) has Clear (when values are chosen) and Sort by count (the default) or Sort by name; the order is a URL parameter (r<report id>_fo_<column>=name) that Apply and Reset keep. With "exclude": true the facet gets an Exclude the selected values switch: the chosen values are then left out instead (rows where the column is empty stay).
  • range: a number or date column in ranges, as radio buttons ("Any", then each range). A range includes its from and excludes its to, so ..1500, 1500..3000 and 3000.. don't overlap. With "custom": true (the default when no ranges are given) users can type their own from and to; those are inclusive (a date to includes the whole day).
  • star: a rating column as "5 stars and up", "4 stars and up", … down to 1 (max, default 5).

With "search": true the panel starts with a search field: the same search as the report's own (r<id>_q, the row as text contains the term). The report then shows no search field of its own (its Actions menu stays), so the page has one.

The panel starts with the number of rows the search and the facets leave (Total row count 14, APEX's Total Row Count).

Facet charts (APEX: facet charts): with "chart": "bar" or "chart": "pie" a facet shows its counts as a chart, collapsed under its heading (Chart). Each bar or slice, and each row of the chart's data table, links to the page filtered on that value (a checkbox facet's value, or a range), the other filters kept. Values with no rows are left out of the chart. In the HR sample, page 21 has a bar chart of jobs and a pie chart of salary ranges.

Attributes:

json
{"report": 57,
 "search": true,
 "facets": [{"column": "job", "label": "Job", "exclude": true},
            {"column": "department"},
            {"column": "status", "limit": 5},
            {"column": "sal", "label": "Salary", "type": "range", "custom": true,
             "ranges": [{"to": 1500, "label": "Below 1500"}, {"from": 1500, "to": 3000}, {"from": 3000}]},
            {"column": "hiredate", "label": "Hired", "type": "range"},
            {"column": "rating", "type": "star", "max": 5}]}
KeyMeaning
reportThe id of the report region to filter
searchtrue: a search field at the top
facets[].columnA column of the report's SELECT
facets[].labelHeading (default: the column name)
facets[].typecheckbox (default), range or star
facets[].limitcheckbox: most frequent values shown (default 12, max 50)
facets[].excludecheckbox: true lets users exclude the chosen values
facets[].rangesrange: [{"from": …, "to": …, "label": …}], numbers or YYYY-MM-DD dates; either bound may be left out (at most 20)
facets[].customrange: true adds from/to fields (default: only when there are no ranges)
facets[].maxstar: the highest rating, 2–10 (default 5)
facets[].chartbar or pie: a chart of the facet's counts under it (faceted search only)

Only filters that a facet on the page allows are read from the URL: a value for a column without a facet, a range that isn't one of the facet's own, or a from/to on a facet without custom is ignored. Values and bounds are sent as query parameters, never as SQL text. A range facet on a column that is neither a number nor a date shows a message instead.

Typical layout: facets region with columns: 3 and template collapsible, report with columns: 9. On phones the facets stack above the report. Without JavaScript an Apply button submits the panel; with JavaScript every change applies at once.


smart_filters ​

The compact alternative to a facets panel (APEX smart filters): one search field above a report, with the filters in use as chips (each with a × to remove it) and suggestions below it. Without a search term the suggestions are each facet's most frequent values (or its ranges); while the user types they are the values that contain the term, and choosing one replaces the term by that filter. If nothing matches, the term searches all columns of the report.

json
{"report": 57,
 "placeholder": "Search or filter employees…",
 "suggestions": 3,
 "facets": [{"column": "job", "label": "Job"},
            {"column": "department"},
            {"column": "sal", "label": "Salary", "type": "range",
             "ranges": [{"to": 1500}, {"from": 1500, "to": 3000}, {"from": 3000}]}]}
KeyMeaning
reportThe id of the report region to filter
facetsAs for facets (checkbox, range and star; exclude and custom are for the facets panel)
suggestionsSuggestions per facet, 0–10 (default 3)
placeholderThe text in the empty search field (translatable)
asktrue: also read the search text as a phrase (sprint 122; APEX 26.2)

With "ask": true the text typed in the search field is also read as a phrase, with the built-in phrases of Ask in your own words (no AI service needed): "clerks in sales with salary between 1000 and 3000", "not clerks, salary at least 2000". What the region's facets can hold is offered as the first suggestion, Understood as:Job: CLERK · Department: SALES · Salary: 1000 – 3000; choosing it sets those facets and clears the search. Values are looked up in the report's own rows (as query parameters). A single value ("clerk") stays the ordinary matching suggestion.

Everything is a link or a GET form on the report's own URL parameters, so it works without JavaScript, can be bookmarked and is kept in saved reports. A facets panel and smart filters may filter the same report; the first definition of a column on the page wins. Give the region template plain and columns: 12 above the report.


display_selector (region display selector) ​

A bar of tabs (or a select list) that shows one region of the page at a time, like APEX's region display selector. Regions take part through their own attributes:

  • "display_selector": true: a tab named after the region's title;
  • "display_selector": "Tab name": regions with the same name share one tab (e.g. a smart filters region and its report). The name is translatable.
json
{"style": "tabs", "show_all": true, "remember": true}
KeyMeaning
styletabs (default), select, or carousel: one region at a time with Previous and Next and a dot per region, without Show all (APEX: the Carousel template)
intervalA carousel turns to the next region every so many seconds (1 to 120); not while the pointer or the focus is in it, nor for users who prefer reduced motion
show_allfalse hides the Show all tab (default: shown)
rememberfalse: don't remember the chosen tab for the browser session (default: remembered per page)

Regions stay where the page puts them; regions hidden by a condition or authorization get no tab. Without JavaScript the bar is a list of links to the regions (#R<id>) and every region shows. With JavaScript the links become accessible tabs (arrow keys, Home and End), the other regions are hidden, and a link to #R<id> opens the tab of that region. In the page designer the display selector's settings list the page's regions with a checkbox and a tab name each.

The HR example's page 21 (Explore, examples/hr/hr_21_regions.sql) has a display selector with three tabs: smart filters over an employee report, a faceted search with a search field, an excludable job facet, salary ranges with from/to, a hire date range and a star rating, and a chart.


map ​

Source: a SELECT with one row per place. The position comes from lat and lng (or latitude/longitude), or from a location column holding latitude,longitude text (what a location item stores). Optional columns: title and body (the popup), id (what a map_object_click dynamic action sees), and geojson (a GeoJSON geometry or feature, e.g. PostGIS st_asgeojson(geom)) to draw lines and areas; a GeoJSON point is a place like a row with lat/lng. With PostGIS installed, a geometry or geography column (in WGS 84, SRID 4326) is enough: the server turns it into GeoJSON.

sql
select dname as title, initcap(loc) as body, lat, lng, deptno
  from hr.dept where lat is not null

The map zooms to fit all places. Attributes:

KeyMeaning
link{"page": 5, "items": {"P5_DEPTNO": "#deptno#"}}: the popup links there (only when the user may open that page)
heightsmall, medium (default) or large
zoomZoom level (1–19) when there is one place; default 14
emptyText when no row has a position
layermarkers (default) or heat: a heat map of the places, each weighted by its weight column (default 1)
clustertrue: group markers that are close together (below)
nameThe name of the region's own layer in the legend (default: the region title)
layersMore layers, each with its own query (below)
visible_areatrue: load only the places in the visible area, again when the map moves (below)
tilestrue: serve the layer as vector tiles, for large data sets (below)
reportThe id of a report region on the same page that the map filters (below)
filterarea (default) or distance: how the map filters that report

Heat map. With "layer": "heat" the places are drawn as a heat map instead of markers: where places (or heavier weights) are close together, the colour is darker. It suits many points, such as visits, incidents or sales. A legend (fewer → more) sits in the corner. GeoJSON shapes are still drawn.

sql
select lat, lng, sal as weight from hr.emp join hr.dept using (deptno)   -- {"layer": "heat"}

Lines, polygons and extruded polygons (sprint 159; APEX: map layer types). "layer": "lines", "polygons" or "extruded" draws only the rows' shapes (a geojson column, or a PostGIS geometry), with a style: {"style": {"fill_color": "#2e5c8a", "stroke_color": "#1b2230", "stroke_width": 2, "opacity": 0.6}}. A row overrides it with columns of the same names (fill_color, stroke_color, stroke_width, opacity); colours are #rrggbb and numbers within range, anything else is left out. A shape's title is its tooltip, title and body its popup. Extruded polygons are shaded by a height column, from light (lowest) to strong (highest), with the height in the tooltip: pgkiln draws them flat, without APEX's 3D view.

sql
select dname as title, st_asgeojson(area) as geojson, headcount as height from hr.sales_area   -- {"layer": "extruded"}

Marker clustering. With "cluster": true markers that are close together at the current zoom level are drawn as one round marker with their number; clicking it zooms in to them. Zooming regroups them, and at the two highest zoom levels every place is shown by itself. Use it for hundreds or thousands of places (a map shows at most 5,000 per layer).

Several layers (APEX: map layers). The region's query is the first layer; layers adds up to seven more, each with its own query (the same columns as above) and its own settings:

json
{"name": "Visits", "cluster": true,
 "layers": [
   {"name": "Offices", "source": "select lat, lng, dname as title, deptno from hr.dept",
    "link": {"page": 5, "items": {"P5_DEPTNO": "#deptno#"}}},
   {"name": "Sales areas", "source": "select dname as title, st_asgeojson(area) as geojson from hr.sales_area"},
   {"name": "Visit density", "source": "select lat, lng from hr.field_visit", "layer": "heat", "hidden": true}
 ]}

Each layer has name (shown in the legend, translatable like other texts), source, and optionally layer (markers, heat, lines, polygons or extruded), style, cluster, link, hidden (off until the user switches it on), no_legend, visible_area and tiles. On a map with more than one layer each layer's places, lines and areas get their own colour, and a Layers legend in the corner switches them on and off. A colour that a lines, polygons or extruded layer's style or a row's fill_color / stroke_color sets is drawn instead of the layer's colour, and the legend shows what is drawn: an area layer's fill, a lines layer's line colour; when the rows have several colours, a split swatch of up to four (sprint 184). A colour the style leaves out (a polygon with only stroke_color has the layer's colour as its fill) stays the layer's colour. Vector tiles are drawn in the layer's colour; a visible-area layer's swatch comes from its style. (sprint 178; APEX: a layer's Display in Legend) A layer with "no_legend": true is left out of the legend: it is always drawn and can't be switched off; the region's own layer takes no_legend in the region's settings. The Layers legend needs at least two listed layers: with one (say, the region's layer and an overlay left out of the legend) there is none, since one check box could only hide that layer. A layer that isn't listed is never off at first: hidden is kept, the Page Designer notes that it isn't used, and it applies again once the layer is listed. A heat map left out of the legend has no heat legend either. Without JavaScript the list below the map has a part per layer. A layer whose query fails shows its error above the map; the other layers are still drawn. In the Page Designer the map's settings have a fieldset per layer (and one empty to add a layer; emptying a layer's query removes it), and the Advisor checks every layer's query. The HR example's page 33 (Field visits) has four layers: clustered customer visits, the offices, sales areas with delivery routes, and a heat map of the visits.

Large data sets: the visible area and vector tiles (APEX: map layers loaded by the visible area, vector tiles). By default a layer's rows come with the page (at most 5,000). Two settings load them as the map needs them instead, per layer (Load in the map's settings):

  • "visible_area": true (Rows in the visible area): the page carries no places for the layer. Once the map shows, and again a quarter second after each move or zoom, the browser asks for the places in the visible area (…/map/<region>/layer/<n>?bb=south,west,north,east) and draws them as usual (markers, clusters, a heat map, lines and areas). At most 2,000 come back; when there are more, the map says Not every place is shown: zoom in to see them all.
  • "tiles": true (Vector tiles): the layer is served as Mapbox Vector Tiles (MVT 2.1), …/map/<region>/tiles/<n>/<z>/<x>/<y>.mvt: each 256-pixel tile holds the rows in its area (with a small margin, at most 10,000 per tile). The browser fetches only the tiles it shows and draws the places as dots and the lines and areas in the layer's colour on a canvas; a click opens the popup of the place, line or area under the pointer. Tiles suit tens or hundreds of thousands of rows; they have no clustering and no list below the map. Any MVT client (MapLibre, OpenLayers, QGIS) can read the same URLs from a signed-in session.

Both filter in the layer's SQL on the server, like the report filter below: on a PostGIS geometry/geography column when PostGIS is installed, else on lat/lng (or location), so an index on those columns (or a spatial index) keeps them fast. A layer without position columns shows an error. The query runs as the application's role with the session's item values, after the same checks as the page (page access, the region's condition and authorization). The HR example's page 41 (Weather stations) has 20,000 stations as vector tiles and the stations above 2,000 m by the visible area.

Filtering a report by the map area (APEX: map as a spatial filter). Give the map "report": <region id> of an interactive report on the same page. When the user moves or zooms the map, a Show this area in the list button appears. It reloads the page with the report showing only the rows in the map's visible area, with a removable Map area chip and a Show everything button on the map. The report needs position columns like a map's (lat/lng, latitude/longitude or location). Without them the chip is marked and nothing is filtered. The area is in the URL (r<id>_bb=south,west,north,east), so it can be bookmarked and saved with a saved report. It also applies to the report's downloads. The HR example's page 16 (Locations) has a heat map of the payroll and an offices map that filters the employee list.

With "filter": "distance" the button reads Show places within … km of the centre instead: the distance is from the map's centre to its nearest edge, and the report shows the rows within that distance (a Within … km chip; the map draws the circle). In the URL it is r<id>_near=latitude,longitude,km. The HR example's page 33 filters its list of visits this way.

Spatial filtering on the server, with or without PostGIS. Both filters run in the report's SQL, never in the browser. When the PostGIS extension is installed in the database and the report has a geometry or geography column (one named geom, geometry, geog, geography, the_geom, shape or location first, else the first such column), pgkiln uses PostGIS: the area becomes ST_Intersects(column, ST_MakeEnvelope(west, south, east, north, 4326)) (two envelopes across the antimeridian) and the distance ST_DWithin(column::geography, point, metres), so spatial indexes can be used and lines and areas count when they touch the area. Geometry columns are expected in WGS 84 (SRID 4326). pgkiln finds PostGIS by itself (it looks in pg_extension once a minute) and calls its functions in the extension's schema, so the application's database role needs USAGE on that schema (PostGIS's default, public, has it). Without PostGIS, or for a report without such a column, the report's lat/lng (or location) columns are compared with numbers: a bounding box for the area, and for the distance a box around the circle first and then the great-circle (haversine) distance on a sphere of 6,371 km. The numbers in the URL are parsed and range-checked first (anything else is ignored), so no text from the URL reaches the SQL.

Below the map a collapsed list names every place (except for layers loaded by the visible area or as vector tiles), so the data is reachable without JavaScript and by screen readers. The map uses Leaflet (shipped with pgkiln, loaded only on pages with a map) and tiles from OpenStreetMap. Their tile usage policy suits light use; for production set MAP_TILE_URL (and MAP_ATTRIBUTION) to your own or a commercial tile server, e.g. https://tiles.example.com/{z}/{x}/{y}.png. The Content-Security-Policy allows images from that server only.

tree ​

Source: a SELECT returning id, parent_id and label, and optionally icon (an icon name). Rows whose parent isn't in the result are the top level; no recursive query is needed.

sql
select empno as id, mgr as parent_id, initcap(ename) || ' · ' || initcap(job) as label
  from hr.emp

Attributes: expanded (levels open at first, default 1), link (as for maps; #id# and any other column), empty. (137) Create page → Tree makes one from a table: the key as the id, a foreign key to the table itself (mgr → empno) as the parent and the name column as the label. The tree is drawn on the server with <details>: it works without JavaScript, and the browser's find-in-page opens closed branches. Clicking a label follows the link; the rest of the row opens and closes the branch. Up to 5000 nodes.

list (lists) ​

A list (APEX: Shared Components → Lists) is a named set of links kept under Shared Components → Lists. A list region shows it; the same list can also be the application's navigation menu or navigation bar (Settings → Theme: Navigation menu list, Navigation bar list). A list is:

  • static: its entries (Shared Components → Lists → a list → Add entry), each with a label, an icon, a target, a badge, a description, a parent entry (a sub menu, up to 6 levels), a sequence, a condition (SQL), an authorization scheme and a build option; or (sprint 165) a badge query instead of a badge: a SELECT whose first value is the badge, run as the application's role with the page's binds, e.g. select nullif(count(*), 0) from sales.orders where status = 'NEW' (no row or an empty value: no badge; a failing query is a page error and no badge); or
  • sql: the rows of a query, run as the application's database role with the usual binds:
sql
select d.dname as label, 2 as page, null::jsonb as items, 'building' as icon,
       (select count(*) from hr.emp e where e.deptno = d.deptno)::text as badge,
       initcap(d.loc) as description
  from hr.dept d order by d.dname

Only label is required; the other columns are page, items (JSON object of item values), url, icon, badge, description, and id / parent_id for nesting. At most 500 rows.

An entry's target is a page of the application with item values ({"P3_ID": "&P2_ID."}; links carry the checksum like other generated links), a path inside the application (2?tab=open), or an http(s):// address (opened with rel="noopener noreferrer"); other URLs (javascript:, //host, ../) are refused when saved and left out when they come from a query or a substitution. Labels, badges and descriptions take &ITEM. substitutions and are always escaped.

Entries the user may not see are left out: a failing condition or authorization scheme, an excluded build option, or a target page the user may not open (the page's authorization, like the navigation menu); a heading without a target and without visible children too. The entry for the current page is marked (aria-current="page"); in the navigation menu its parents are open.

Attributes (the region's Settings in the page designer):

KeyMeaning
listThe list's name (upper case)
templatelinks (default: nested links), badges (a row of tiles with the badge as the value), cards (a card per entry with its description; (sprint 88) a colour band and the icon in a round badge, in the chart palette's order), tabs (the top-level entries as tabs) or wizard_progress (numbered steps: the entry of the current page is the current step, the ones before it are done and link back; APEX: Wizard Progress)

The HR example's page 31 (Shortcuts) shows a static list with each template (with a badge from an item, child entries, a manager-only entry and one of an excluded build option) and a department list from a query; its navigation bar is the list HR_NAVBAR.

data_reporter (Data Reporter) ​

A Data Reporter region (APEX 26.1: Data Reporter) lets business users build their own reports in the running application, without the developer writing a page per question. The developer decides what may be reported on; users decide how.

The developer places the region (page designer gallery: Data Reporter) and, in its Settings, adds data sources: a table or view each (pgkiln's own meta schema and the system schemas are never offered), with a static id, a label and a description users see. Every column of the source is listed: tick the ones users may use and give them labels and, for numbers and dates, a format mask. New sources offer all columns except binary ones at first. A view that shows exactly what business users may see is often the best source; the builder warns when the application's database role may not read it.

Users start on the region's welcome page (APEX 26.1: the Data Reporter's welcome page): a greeting, the data sources as cards (label, description, number of columns), their own reports with the latest changed first, and the reports others shared; with more than six reports (or a search term) a search over names and descriptions. A source's card opens a new report in the editor (a plain form: it works without JavaScript, and the URL of a result can be bookmarked or sent):

  • Columns to show (all offered columns when none are ticked);
  • up to five filters (column, operator, value; the operators of interactive report filters);
  • up to three Group by columns and five totals (count, sum, average, minimum, maximum of a column, or the number of rows). With a group column the result has one row per group (at most 1000); totals without one give a single row over all rows;
  • up to three sort columns (in a grouped report: the group columns and the totals);
  • a chart (bar, column, line, area, donut, pie) of the totals by the first group column, drawn on the server like other charts.

Signed-in users save a report under a name (with a description), privately or shared with everyone who can see the region, open their own and shared reports from the region's list, change their own (Save, Save as new, Delete) and copy someone else's shared report by saving it under their own name. Detail rows are paged (page_size, 25 by default).

How it stays safe:

  • reports run as the application's database role: grants and row level security apply, so two users running one shared report may see different rows;
  • a definition (from the URL or a saved report) is checked before it runs: only offered columns that exist and can be read, whitelisted operators and functions (sum and average on numbers only), bounded counts and lengths; anything else is dropped. Identifiers are only the developer's schema, table and column names, always quoted; filter values are escaped literals;
  • reports are stored in meta.data_report, reached by applications only through the view meta.data_reports (the user's own and shared reports of the application) and the functions meta.save_data_report / meta.delete_data_report, which only change the signed-in user's own reports. Saving and deleting need the CSRF token and a region the user can see.

Attributes (written by the region's Settings):

KeyDefaultMeaning
sources[{"id": "orders", "label": "Orders", "description": "…", "schema": "sales", "table": "order_v", "columns": [{"name": "total", "label": "Total", "format": "FML999G990D00"}]}]; (sprint 110) or a dataset: {"id": "sales", "dataset": "sales"} (label and description optional)
sharingtruefalse: reports stay private
share_authzAn authorization scheme: only users that pass it may share reports
edit_authz(sprint 110) An authorization scheme: only users that pass it build, change, save and delete reports; the others only run shared ones
admin_authz(sprint 110) An authorization scheme: users that pass it unpublish and delete anyone's reports
publishingfalse(sprint 110) true: shared reports are published: a stable URL, Publish / Unpublish buttons, pins
page_size25Rows per page of a detail report (5 to 200)
welcometruefalse: the compact start (a list of sources and Start) instead of the welcome page
welcome_title, welcome_textThe welcome page's greeting instead of pgkiln's (translated like other application texts)
emptyNo data found.Text when there are no rows

The sources travel with the application export (they are the region's attributes); users' reports are user data, like saved reports, and stay with their region when an application is replaced. The HR example's page 36 (My reports) offers employees (a view without the user name and photo columns) and leave requests (row level security: an employee sees only their own), with King's shared report Salary by department.

Datasets and reporting applications ​

(sprint 110) A source may be a dataset of the workspace (App Builder → Data Reporter): tables and views of one schema with their joins, the offered columns with labels, format masks and descriptions (shown under the column in the editor), and a row filter. The region's Settings add one under Add a data source → Or a dataset of the workspace. The runtime reads the dataset when the page is drawn and builds its SELECT from the definition (identifiers quoted, values escaped literals, operators from the whitelist), and the report runs on it as a subquery, as the application's database role. A dataset that was deleted disappears from the region; a column that no longer exists makes the report show an error.

With publishing, shared reports are published: an editor saves a report privately and Publishes it (or ticks Publish for all users when saving), and Unpublishes it again. A published report has a stable URL, /a/<alias>/reports/<id>, shown on the report: it opens the report on its page (signing in first), so it can be bookmarked or sent. Every signed-in user may Pin a published report: pinned reports come first on the welcome page (a preference of the user, reporter.pins.<region>). Users that don't pass edit_authz see only the published reports: no New report cards, no editor (report parameters in the URL are ignored), no saving. Users that pass admin_authz unpublish and delete anyone's reports. The HR example's dataset hr (examples/hr/hr_63_datasets.sql: employees with their department, active ones only) is the one a reporting application is made from in the guide's chapter 3.

form_designer (Form Designer) ​

A Form Designer region (sprint 85; pgkiln's own, APEX has no counterpart) lets the application's administrators build their own data entry forms in the running application, without a developer and without a new release. Like the Data Reporter, the developer decides what may be edited; the administrators decide how the forms look and who uses them.

The developer places the region (page designer gallery: Form Designer) and, in its Settings, chooses who may design forms (an authorization scheme; without one nobody can) and adds data sources: a table or view each (pgkiln's own meta schema and the system schemas are never offered), with a static id, a label and a description. Per source:

  • the columns forms may show and change, with a label and, for a select list or radio group, a list of values: a shared one of the application (LOV:NAME) or STATIC:Display;value,… (never SQL: designers can't write queries);
  • the key column that identifies a row (the primary key of a new table; choose one for a view), needed to change and delete rows;
  • what forms on it may do at most: add, change and delete rows.

A new source offers all its columns except binary and JSON ones, allows adding and (with a key) changing rows, never deleting. Untick generated keys and audit columns; the builder warns when the application's database role lacks a privilege a source needs.

Designers (users that pass the scheme) see New form and a Design form link under each form. The designer is a plain form (it works without JavaScript): a name, a description, what users may do (within what the source allows) and a row per offered column: On the form, Order, Label, Help text, Required, Display (a field by the column's type; a text area for text; a select list or radio group for a column with a list of values) and a Default for new rows, and In the list for the columns of the form's list of rows. A form is a draft until Published is ticked: only designers see drafts.

Users see the published forms as cards. A form with list columns opens on its rows (newest first, paged, page_size) with Add and an Edit link per row; a form without list columns only adds rows: it opens on an empty form, and after Save on the next empty one. Fields follow the column's type: a number field, the date picker in the application's date format for dates, the browser's date and time field for timestamps, a checkbox for booleans.

How it stays safe:

  • rows are read and written as the application's database role: grants and row level security apply (in the HR example an employee changes only their own meetings);
  • a form's definition is checked against the region's settings before it renders or saves: only offered columns that exist and can be read, displays the column's type allows, actions the source allows; anything else is dropped. Only the form's fields are written; identifiers are only the developer's schema, table and column names, always quoted; values and row keys are always parameters; a value of a list of values must be in the list;
  • lost updates are refused: a row changed since its form was opened is not overwritten (the user sees what they typed, with a message);
  • forms are stored in meta.user_form, reached by applications only through the view meta.user_forms (the forms of the application) and the functions meta.save_user_form / meta.delete_user_form; saving rows and forms needs the CSRF token and a region the user can see, designing also the region's authorization scheme. Every saved, changed or deleted row and form is in the activity log (event form_designer).

Attributes (written by the region's Settings):

KeyDefaultMeaning
sources[{"id": "orders", "label": "Orders", "description": "…", "schema": "sales", "table": "orders", "key": "id", "columns": [{"name": "customer", "label": "Customer"}, {"name": "status", "lov": "LOV:ORDER_STATUS"}], "insert": true, "update": true, "delete": false}]
design_authzThe authorization scheme designers pass; none: nobody designs
page_size25Rows per page of a form's list (5 to 200)
emptyNo data found.Text when a form's list has no rows

The sources travel with the application export (they are the region's attributes); the forms are data of the installation, like Data Reporter reports: not exported, and they stay with their region when an application is replaced. The HR example's page 45 (Forms, under Administration) offers departments, meetings and employees (changing only) to administrators, with the published forms Departments and Book a meeting.

json_form (JSON form) ​

A JSON form region (sprint 246; APEX has no counterpart, Appsmith calls it JSON Form) draws a form from a JSON schema instead of from table columns. Use it when the questions are data: inspection checklists, intake forms or surveys an administrator keeps in a table, one schema per row, whose answers are stored together as one jsonb value. A new form is then a new row, not a new page.

The region's Source is a SELECT that returns one row, run as the application's database role (grants and row level security apply): the schema (a column named schema, else the first) and the current answers (a column named value, else the second; null or no column for a new form). jsonb, json and text holding JSON are all read.

sql
select t.schema, a.answers as value
  from sales.form_template t
  left join sales.form_answer a on a.template_id = t.id and a.order_id = :P3_ID
 where t.id = :P3_TEMPLATE

The schema is an object with properties; each property becomes a field:

PropertyField
"type": "string"text field; "x-widget": "textarea" a text area; "format": date, time, date-time, email or uri the browser's date, time, date and time, e-mail or URL field
"type": "number" / "integer"number field (an integer field takes whole numbers only)
"type": "boolean"checkbox (always true or false in the answers)
"enum": [...] (with "x-enum-labels" or "enumNames"), or "oneOf": [{"const": …, "title": …}]select list; "x-widget": "radio" a radio group. The answer is the value itself (a number stays a number)
"type": "array" with "items": {"enum": [...]} (or oneOf)checkbox group; the answer is a list of the chosen values
"type": "array" with "items": {"type": "object", "properties": …}repeating rows: each row a group of its fields, with Add a row and Remove
"type": "object" with propertiesa group of fields (a fieldset), its answers an object
anything else (a list of plain strings, a nested repeat)not shown; its stored answer is kept as it is

Per property: title (the label; else the key), description (help text under the field), x-placeholder, readOnly: true (shown, never changed by the form: the stored answer is kept), default (a new form's value). The fields follow the object's x-order (a list of keys; per property also a number "x-order": 3), then the order of the schema; keep an x-order, because jsonb sorts keys by length. The root's description is shown above the fields.

Answers. The region's attribute item names a page item, normally a hidden one, in the region: on submit the answers become one JSON value in that item ('{"location": "B2.14", "score": 7, …}'), and a process stores it, e.g. update sales.form_answer set answers = :P3_ANSWERS::jsonb where …. Before any computation, validation or process runs, the server reads the schema again and checks the answers against it; an answer that fails is refused and shown at its field, with the other fields as they were typed, like an item validation:

  • required (a list of keys per object): the field must be filled in (a checkbox group or repeating rows: at least one);
  • enum / oneOf: only the listed values; the property's type: a number, a whole number, a boolean, text;
  • minimum, maximum, exclusiveMinimum, exclusiveMaximum; minLength, maxLength (text has at most 20,000 characters without one); minItems, maxItems (checkbox groups and rows); valid dates, times, e-mail addresses and http(s) URLs for the formats.

Only the schema's fields are read from the request: other posted names, and a value posted for the item itself, are ignored; a property the form can't show keeps the stored answer. Everything the schema says (titles, descriptions, labels, placeholders, keys) is shown as text, never as HTML.

Read-only. {"read_only": true}, the region's Read Only condition, or no item (or one the user can't change) shows the answers as text, repeating rows as a list of groups; a submit leaves the item alone.

Without JavaScript the form works as it is: repeating rows show a few empty rows under the others (empty_rows, 2) and a Remove row box per row; an empty row is left out of the answers. With JavaScript Add a row adds one and Remove row takes one away at once.

KeyDefaultMeaning
itemThe page item the answers post into, as JSON text (a hidden item: only the server writes it). Without it the form is read-only
read_onlyfalseShow the answers only
empty_rows2Empty rows of a repeating field without JavaScript (0 to 10)

The HR example's page 74 (Inspections, under Administration) keeps two forms in hr.form_template and the answers per user in hr.form_answer, with a second, read-only JSON form region for the saved answers. The APEX importer has no APEX region to map to it.

ai_assistant (AI assistant) ​

An AI assistant region (APEX: AI Assistant, AI agents and tools) is a chat with an AI service (Claude, OpenAI, Gemini or an OpenAI-compatible endpoint) that an administrator configured and allowed for the application. Either the region names an AI agent of the application ("agent": "SALES_AGENT": the agent sets the service, system prompt, reasoning effort, tools, steps and output limit, and its authorization scheme decides who may use the region; tools may also be PL/pgSQL functions, JavaScript actions and links to pages), or the developer gives the region a system prompt and, optionally, context queries and tools; the model then answers questions about the application's data, calling the tools when it needs to, like an agent. It works without JavaScript (the message is posted and the page comes back with the answer); with JavaScript the answer streams (sprint 148): the message appears in the conversation, the answer is written into it as the model produces it (as plain text), the tool being used is named under it, and when the answer is complete the page loads with it formatted, with its links and the agent's browser actions. Ctrl+Enter sends. Streaming uses server-sent events (Accept: text/event-stream on the same Send URL: text pieces as JSON strings, tool names, then done with the page to load); a proxy in front of pgkiln must not buffer the response (pgkiln sends X-Accel-Buffering: no for nginx). OpenAI, Gemini and OpenAI-compatible services are asked to stream with their usage; an endpoint that refuses streaming (HTTP 400) gets the ordinary request once.

  • Conversations are kept per session and region (meta.ai_conversation): a follow-up question sends the earlier messages along. New conversation starts over; signing out (or the session's end) deletes it. Another user, or another session of the same user, never sees it. A conversation holds at most max_turns questions (20).

  • Context queries run before each question, as the application's database role (grants and row level security apply), read only, with :AI_PROMPT bound to the question (and :APP_USER, items as usual). Their rows (at most max_rows, 50) go to the model as delimited data (&lt;data name="context:policy">…&lt;/data>) in the user's turn: a simple retrieval (RAG) over tables you choose, e.g. full-text search on policy texts.

  • Tools are SQL queries or REST data sources the model may call with arguments you declare (parameters: string (optionally an enum), integer, number, boolean or date; "optional": true allows none). pgkiln sends them as strict tools (JSON schemas with every property required, no others), checks the model's arguments against them again and runs the tool:

    • a SQL tool runs as the application's role; the arguments are bind variables (:NAME, escaped literals, never SQL text) next to the usual :APP_USER and items (parameter names can't start with APP_). The SQL is one query (wrapped as a subquery, at most max_rows rows, a 15 s time limit) and is rolled back afterwards, unless the tool has "writes": true (for a function that changes data, e.g. one that files a request). Errors go back to the model as the message a user would see;
    • a REST tool ("type": "rest", "source": "NAME") calls a REST data source of the application; the arguments are its parameters (as given: &ITEM. in them is not substituted), other parameters keep their defaults;
    • "authz": "SCHEME" offers a tool only to users who pass the authorization scheme.

    The model gets at most max_rounds (5) rounds of tool calls per question, then must answer.

  • The answer is shown escaped, with paragraphs, bullet and numbered lists, **bold** and `code` as the only formatting. It is never run as SQL or HTML.

  • Signed-in users only, unless the application has no sign-in or the region says "public": true (every question costs tokens). The service's daily limits apply to every call to the provider (a question with tool calls makes several); each call is logged in the AI usage log with the source assistant.

What goes to the provider: the system prompt (with &ITEM. values as delimited data, never the session id or passwords), what the user types, the context rows and the tools' results. Choose context queries and tools that return only what the user may see anyway (row level security helps).

Attributes (written by the region's Settings; they travel with the application export):

KeyDefaultMeaning
agent(121) An AI agent of the application; then leave out service, system, tools and max_rounds
serviceThe AI service's name
systemThe system prompt (&ITEM. substitutions as delimited data)
welcomeThe first message shown (translatable)
placeholderPlaceholder of the message box
context[{"name": "policy", "sql": "select title, body from hr.policy where … :AI_PROMPT …", "max_rows": 5}]
tools[{"name": "my_leave", "description": "…", "sql": "select … where status = :STATUS", "parameters": {"STATUS": {"type": "string", "enum": ["PENDING", "APPROVED"], "optional": true}}, "max_rows": 50, "writes": false, "authz": "SCHEME"}, {"name": "weather", "type": "rest", "source": "WEATHER", "description": "…", "parameters": {"city": {"type": "string"}}}]
max_rounds5Rounds of tool calls per question (1 to 10)
max_turns20Questions per conversation (1 to 100)
publicfalseAlso for users who are not signed in
error_messageShown instead of the service's error (not for daily limits)

The HR example's page 38 (HR assistant) has an assistant with a context query over hr.policy and four tools (the user's own leave, colleagues, departments, and request_leave, which files a leave request), next to a staff list with Ask in your own words.

Template components ​

A template component (APEX 23.1+) is a piece of HTML with placeholders, kept under Shared Components → Template components and used in two places:

  • as a region of type template_component: one instance per row of the region's query (or once, without a query), or all rows inside the component's wrapper;
  • as a column template of a report: the cells of one column are drawn by the component.

A component has a static id (e.g. status_badge; regions and columns refer to it by this id), a name, a version, the template of one instance, an optional wrapper, layout classes and custom attributes.

Built-in template components ​

Every application can use these without importing anything (APEX: the Universal Theme's template components, with 26.1's Metric Card and group support). Show a region as multiple to get the group:

Static idComponentAttributes (default: the column of that name)As multiple
ut_avatarAvatar: a picture or initialsNAME, INITIALS, IMAGE (a relative or https URL), SIZE (small, medium, large), SHAPE (circle, square)An avatar group (overlapping)
ut_badgeBadge coloured by a stateLABEL, STATE (success, warning, danger, info, neutral; approved, pending, … are understood)A row of badges
ut_commentsCommentsUSER, INITIALS, DATE, COMMENT, ACTIONS (extra text)One conversation
ut_content_row(137) Content row: initials or a picture, title (linked when the region has a link) and description, a secondary text and a badge on the rightTITLE, DESCRIPTION, MISC, INITIALS, IMAGE, BADGE, STATEOne list
ut_media_listMedia list: picture or initials, title (linked when the region has a link), description, badgeTITLE, DESCRIPTION, INITIALS, IMAGE, BADGE, STATEOne list
ut_metric_cardMetric card: a key figure with its unit, change and trendLABEL, VALUE, UNIT, CHANGE, TREND (up, down, flat), GOOD (up or down: which direction shows green), DESCRIPTIONA row of cards
ut_timelineTimeline: when, who, title, text, a coloured markerTITLE, WHEN, WHO, BODY, STATEOne timeline

They also work as report column templates (e.g. ut_badge on a status column). To change one, open Shared Components → Template components → Add and choose Copy into this application: the application's component with the same static id then replaces the built-in one everywhere in the application. HR page 39 Team overview uses all of them except the badge.

(sprint 231, AX-14; APEX lists them in the gallery and the region Type list) In the Page Designer each built-in component is a region type of its own: the gallery's Regions tab and a region's Type list have Avatar, Badge, Comments, Content Row, Media List, Metric Card and Timeline (right after Template Component). Dragging one onto the layout, or choosing it in the create form, makes a template_component region of that component with a sample query (its columns are the component's attributes) and, for the ones with a group, Display multiple; edit the query and the settings as for any template component region. A region of a built-in component shows the component's name as its type in the tree, the layout and the Type list; choosing another one in the Type list switches the component (the attribute values of the old one go, its query stays). They are not stored as types: the region is template_component with config.component, so exports, imports and the APEX importer are unchanged. The application's own components stay under Template Component, chosen on the region's Attributes tab.

The template language ​

html
<span class="tc-badge tc-badge-{case STATE/}{when ok,approved/}success{when late/}danger{otherwise/}neutral{endcase/}">#LABEL#</span>
SyntaxMeaning
#NAME#a custom attribute, a column of the row, #LINK#, #APEX$ROW_NUM# (and in a wrapper #APEX$ROW_COUNT#). Always HTML-escaped; there is no raw form (#NAME!RAW# is refused)
#NAME!STRIPHTML#the value with tags removed, then escaped
{if NAME/}…{elsif ?NAME/}…{else/}…{endif/}NAME: true (not empty, not N/no/false); ?NAME: not empty; !NAME: not true
{case NAME/}{when a/}…{when b,c/}…{otherwise/}…{endcase/}compare a value (ignoring case) with one or more values
{loop "," NAME/}#APEX$ITEM# #APEX$I#{endloop/}each part of a value split on a separator (default :)
#APEX$ROWS#in the wrapper only, exactly once: where the rows go

Templates may come from plug-in files someone else wrote, so they are held to more than "developer HTML is trusted". When a template is saved, imported and rendered, pgkiln checks it against an allow-list:

  • only ordinary content elements (div, span, p, a, img, ul, table, time, …): no <script>, <style>, forms, frames, <svg> or comments;
  • no event handler (on…), style or data-* attributes; every attribute value is quoted;
  • placeholders and directives only in text or inside a quoted attribute value, and a directive block starts and ends in the same place, so leaving a branch out never leaves half a tag;
  • href, src and cite allow only http(s), mailto:, tel: and relative URLs. They are checked again after substitution: a value like javascript:alert(1) drops the attribute.

So whatever the data, the page gets exactly the template's elements and attributes. For links to pages of the application use #LINK#: pgkiln fills it with a checksummed URL (and opens modal pages as a dialog). The look comes from classes (the Content-Security-Policy blocks inline styles): tc-badge (-success, -warning, -danger, -info, -neutral), tc-card, tc-card-head, tc-avatar, tc-title, tc-meta, tc-body, tc-actions, tc-stack, tc-row, tc-muted, tc-timeline, tc-timeline-item (tc-state-success, …), plus everything else in app.css.

Layout classes set how a region lays out the instances: tc-list (default, one below the other), tc-grid (responsive columns), tc-inline (in a line), tc-divided (with rules), tc-compact.

Custom attributes (JSON) are the component's settings, filled in where it is used:

json
[{"name": "LABEL", "label": "Label", "type": "text", "default": "#STATUS#"},
 {"name": "STATE", "type": "select", "options": ["ok", "late", "other"]},
 {"name": "COMPACT", "type": "checkbox"}]

Types: text, number, select (with options), checkbox (Y/N). A value (or default) may contain #column# and &ITEM. substitutions, so "default": "#STATUS#" makes the component work on any query with a status column. LINK is reserved.

The component's page in the builder shows its attributes, the columns it expects and a preview with sample rows (NAME=value per line, a blank line between rows).

As a region ​

Choose Type template_component and a Source SELECT (or none, for one instance from the attributes). Under the region, Template component settings writes its config:

json
{"component": "contact_card",
 "attributes": {"SUBTITLE": "#job#"},
 "display": "multiple",
 "link": {"page": 3, "items": {"P3_EMPNO": "#empno#"}},
 "max_rows": 50, "empty": "No colleagues yet"}

display: each (default) or multiple (all rows in the component's wrapper, e.g. one <ol class="tc-timeline">). link fills #LINK# (empty for users who may not open the page). At most 500 rows.

As a report column template ​

Under a report region, Column templates picks a component per column, with attribute values (NAME=value per line). The template sees every column of the row as #NAME# (also hidden ones), and #LINK# is the report's link. Stored in the region's config:

json
{"column_templates": {"status": {"component": "status_badge", "attributes": {"STATE": "#status#"}}}}

Column templates apply to the report view (not to downloads, which keep the plain value).

Pictures from other sites ​

(sprint 235) A component's <img src="#IMAGE#"> (the built-in Avatar, Content row and Media list, or your own) may show a picture from another site, e.g. a column with https://images.example.com/p/7.png. The page's Content-Security-Policy normally allows pictures from the application's own server only; pgkiln adds the origin of every https picture a region or report column template actually renders (https://images.example.com) to that page's img-src, like a display image item does. Only https URLs without a user name or password count, and only their origin (never a path, a wildcard or another scheme): an http: picture, or one over the limit of 50 origins per page, is blocked by the browser. A cached region keeps its origins with its HTML. A lazy region whose pictures come from a site the page didn't allow yet loads the page again with the region in it (as its Show link does without JavaScript); after a Refresh region dynamic action, a master-detail selection or a search region's update, pictures from an origin the page didn't show when it loaded stay blocked until the page is loaded again.

Plug-ins ​

A component travels as one JSON plug-in file ("format": "pgkiln-plugin/1", "type": "template_component"): Download plug-in file on its page, and Import a plug-in under Shared Components → Template components → Add (optionally replacing a component with the same static id). The template is checked before anything is saved. In SQL:

sql
select meta.export_template_component(<app id>, 'status_badge');
select meta.import_template_component(<app id>, '<plug-in json>'::jsonb, p_replace => false);

examples/plugins/ has three to start from: status-badge, contact-card and timeline-item. The HR example installs them (examples/hr/hr_19_template_components.sql): page 19 (Team) shows contact cards linking to the employee form, recent hires on a timeline, and leave requests with a status badge. Template components are part of an application export (template_components).

Plug-ins with their own code ​

APEX's region, item, dynamic action and process plug-ins. A plug-in file ("format": "pgkiln-plugin/2") brings, by type:

typeBringsUsed as
regiona template component that renders the region's rows, and JavaScript that gets the regiona region of type plugin
itemJavaScript that enhances a text field (the value is posted and stored as text, so the form works without it)an item of type plugin
dynamic_actiona JavaScript functiona dynamic action with action plugin, Code the plug-in's name
processa PL/pgSQL function schema.fn(attributes jsonb) returns text (the message), usually created by its install SQLa process of type plugin

Every plug-in has custom attributes (like a template component's: text, number, select, checkbox, with defaults); a region, item or process sets their values in config, a dynamic action in its config:

json
{"plugin": "show_more", "attributes": {"VISIBLE": "4", "BUTTON": "Show everyone"}}

Values may contain &ITEM. substitutions. JavaScript and CSS are static application files that come with the plug-in; pages that use it load them. The JavaScript registers the plug-in by name:

js
pgkiln.plugins.register('show_more', ({ type, element, item, attributes }) => {
  // region and item plug-ins: element is the region's (or field's) element; called again after a refresh
  // dynamic action plug-ins: the action's context (items, elements, region, value, message) and attributes
});

The page passes the plug-in's name and attribute values in data-plugin and data-plugin-attrs (and in the dynamic action's JSON); code never travels in the page, so the Content-Security-Policy stays script-src 'self'. A region plug-in's template is an ordinary template component (checked against the allow-list above); its attributes are the plug-in's, and a region Source SELECT gives it rows.

Install SQL (tables, functions, grants a plug-in needs) is shown under Shared Components → Plug-ins and runs only when a developer asks, as the application's database role, in one transaction. A plug-in's code runs with the application's rights: install only plug-ins you trust, after reading their files.

A plug-in file is built from a source directory with pgkiln plugin build <dir>: plugin.json (the file without contents: type, name, label, version, help, attributes, files, template_component, sql_function), the files it lists, template.html (and wrapper.html) for a region, and install.sql. pgkiln plugin install <file|dir> --app <alias> adds it to an application; so does Import a plug-in in the builder and, in SQL, meta.import_plugin(&lt;app id>, '&lt;plug-in json>'::jsonb, p_replace => false). Download plug-in file gives it back. Plug-ins are part of an application export (plugins; shared/plugins/ in a directory export).

examples/plugins/ has four, each as a source directory and a built file: show-more (region: the first rows and a Show all button), char-counter (item: a maximum length with a live count), copy-value (dynamic action: copy an item's value to the clipboard) and log-event (process: record an event in pgkiln_plugins.event_log). HR example part 47 installs them and uses all four on page 40 (Plug-ins).

search (search region) ​

One search field over several sources, with the results grouped per source (APEX 22.2: the Search region and search configurations). Each source is a search configuration (Shared Components → Search configurations):

PropertyMeaning
NameThe static ID the region names, e.g. CUSTOMERS
LabelThe heading of its results (translated like the page's texts)
SequenceThe order of the groups
Source type, sourcetable: a table or view (sales.customers) · sql: a SELECT, :ITEM binds allowed · list: the entries of a list the user may see (their label and description are searched, they link where the entry links)
Searchable columnsThe columns the search text is looked for in. Empty: the title, subtitle and description columns
Title, subtitle, description, badge columnWhat each result shows. The title is required (table, sql), and results are ordered by it
IconAn icon name, or #COLUMN# for a column that holds icon names
LinkWhere a result goes: {"page": 3, "items": {"P3_ID": "#ID#"}} (#COLUMN# is the row's value; the link gets a checksum, a modal page opens as a dialog)
Maximum resultsPer configuration, 1–100 (default 10); "Showing the first n rows." when there are more
Search type(sprint 135) standard: the words as below · fulltext: PostgreSQL full-text search (table and sql sources; see full-text search) · (sprint 136) vector: by meaning, the rows whose embedding is nearest to the search text's · hybrid: full-text and vector together (see vector search)
tsvector column or expressionfulltext: a tsvector column of the source (best: with a GIN index), or an expression such as to_tsvector('english', title || ' ' || body). Empty: to_tsvector over the searchable columns on every search
Text search configurationfulltext: english, dutch, german, simple… (pg_ts_config): the one the tsvector was made with. Empty: the application's primary language's, else simple
Did you meanWith the pg_trgm extension installed: when nothing is found, a link that searches for the closest words of the searched columns (any search type; reads up to 10,000 rows). Without pg_trgm nothing is suggested
Vector providervector, hybrid: the vector provider (static ID) that embeds the search text: the same one that embedded the rows
Vector columnvector, hybrid: the source's vector(n) column, n the provider's dimensions
Key columnhybrid: the key (e.g. id) that matches the full-text and the vector results
Distancecosine (default; most embedding models), l2 or inner_product; an HNSW index helps only when it is built for the same one
Minimum similarityvector, hybrid: rows less similar than this are left out (cosine: 1 − distance; inner product: the product; l2: 1 / (1 + distance)). Empty: the nearest rows, however far

How it searches. Each word of the search text must be found (case-insensitively, anywhere in the value) in one of the searchable columns, so clerk mil finds MILLER the clerk. % and _ are plain characters. The text is a query parameter, never SQL; the queries run as the application's role (its grants and row level security apply), each on its own, so a configuration that fails shows its error and the others still answer. The found words are marked in the results.

sql
-- a configuration on a query: employees with their department
select e.empno, initcap(e.ename) as name, initcap(e.job) as job, d.dname as department
  from hr.emp e left join hr.dept d on d.deptno = e.deptno

with searchable columns name, job, department, title name, subtitle job, badge department and link {"page": 3, "items": {"P3_EMPNO": "#EMPNO#"}}.

A configuration of search type fulltext (APEX: the search type Oracle Text) uses PostgreSQL's full-text search instead of matching the words letter for letter:

  • Stemming: in the english configuration running shoes finds a row with run and shoe. The text is read with websearch_to_tsquery, so users can write "exact phrase", shoes or boots and shoes -polish.
  • Ranking: the best match first (ts_rank_cd; words close together and in a column with weight A count more), then by the title.
  • Highlights: the title and subtitle come back with every matched word marked, the description as the fragments around the matches (ts_headline). Everything is escaped: only ts_headline's own marks become <mark>, the data's characters are always text.
  • The tsvector: name a tsvector column of the source. The quickest way to make one is SQL Workshop › Table Properties › Add full-text search (chapter 3): a generated column over the text columns, weighted, and a GIN index on it. An expression works too (a GIN index on the same expression helps); with neither, the searchable columns are turned into a tsvector on every search, which reads the whole table.
  • The text search configuration is checked against pg_ts_config and passed as a query parameter; use the one the tsvector was made with. Empty: the configuration of the application's primary language (en → english, nl → dutch, de → german, fr, es, it, pt, sv, da, nb, fi, ru, tr, el, ar…), else simple (no stemming; for Japanese, Chinese and Korean).
  • Did you mean: with pg_trgm installed (create extension pg_trgm), a configuration that asks for it suggests, when nothing at all is found, the search text with each unknown word replaced by the most similar word of its searched columns (as the user: row level security applies). Without pg_trgm nothing is suggested and nothing fails.
sql
-- what Add full-text search writes (HR example part 71, hr.policy)
alter table hr.policy
  add column search_vector tsvector generated always as (
    setweight(to_tsvector('english'::regconfig, coalesce(title, '')), 'A') ||
    setweight(to_tsvector('english'::regconfig, coalesce(body, '')), 'B')) stored;
create index policy_search_vector_idx on hr.policy using gin (search_vector);

with search type fulltext, tsvector search_vector, configuration english, title title and description body. The Advisor warns when a fulltext configuration's column has no GIN index (or its tsvector is built on every search), reports a configuration name that doesn't exist, and a column that isn't a tsvector. A report's search box can use the same engine: see its fulltext attribute.

A configuration of search type vector (APEX: the search type Oracle Vector Search) finds rows by meaning: time off for a family move finds the policy Relocation leave … relocate to another city … the new house, though they share no word. It needs the pgvector extension (see chapter 3 for installing it), a vector provider and a vector column:

  1. A vector provider (Shared Components → Vector providers, chapter 3): an AI service with an embedding model (OpenAI text-embedding-3-small, Gemini, Ollama's nomic-embed-text …) or a SQL function returning vector.
  2. A vector column on the table, kept current: SQL Workshop › Table Properties › Add vector column (chapter 3) adds embedding vector(n), an HNSW index and a trigger, and queues the rows for their embeddings.
  3. The configuration: search type vector, the provider, the vector column, title and description columns, icon and link as for any configuration.

When a user searches, pgkiln embeds the search text with the provider (an AI service: one request, remembered a few minutes for search-as-you-type, logged under AI usage; the text goes to that provider), then asks the database for the nearest rows (order by embedding <=> $1 limit n, which the HNSW index serves) as the application's role, so row level security decides what is found. The vector is a query parameter; pgvector's operators are called schema-qualified. Results are not marked word by word: they need not contain the words.

Hybrid (hybrid) runs the full-text search (the tsvector and text search configuration above) and the vector search, takes the best 50 rows of each, and ranks them together by reciprocal rank fusion: each row scores 1 / (60 + its rank) in each list it is in, summed, best first. Rows found by both rise to the top; a row that only one of them finds still shows. Hybrid needs the key column that tells which rows are the same.

Without pgvector a vector or hybrid configuration shows that the extension is missing (and the Advisor reports it); the other configurations answer as before. The Advisor also checks that the provider exists, that the column is vector(n) with the provider's n, and warns when it has no HNSW index or one for another distance. The HR example (part 72) adds POLICIES_MEANING (hybrid, with a stand-in function provider) to page 42.

An AI agent can use any table or SQL configuration as a Retrieve tool: the model gives a text, the agent gets the best rows (AI agents).

The region: attributes

KeyMeaning
configsThe configurations it searches, e.g. ["CUSTOMERS", "ORDERS"]; empty or left out: all of the application's
itemSearch with this page item's value ("P1_SEARCH") instead of a field of the region's own; refresh the region from a dynamic action, or let the item submit the page
placeholderThe field's placeholder
min_lengthSearch only from this many characters (default 1)
emptyThe text when nothing is found (default "Nothing found.")

The region's own field is a GET form (?s<region id>=text, so a search can be bookmarked) and works without JavaScript; with JavaScript it searches while the user types and replaces only the results. The Advisor plans every configuration with the columns it names and reports names a region uses that don't exist. Search configurations are exported with the application. The HR example's page 42 searches employees, departments, the HR policies (full-text, part 71; by meaning, part 72) and the shortcuts list.

url (URL region) ​

Shows another site's page in the region, in a sandboxed <iframe> (APEX: URL region).

Source: the URL. Its scheme and host are written out, so an item can never choose which site is shown; &ITEM. substitutions are allowed after the host and are URL-encoded:

text
https://reports.example.com/dashboard?customer=&P3_CUSTOMER_ID.&lang=&APP_LANGUAGE.
  • https:// only (http:// for localhost during development), no user name or password in the URL. A path that starts with / shows a page of this server, such as another pgkiln application (/a/portal/1).
  • The page's Content-Security-Policy gets frame-src for exactly the origins of its visible URL regions; other pages frame nothing. The Advisor reports a URL that isn't allowed.
  • The other site decides whether it may be framed: many sites forbid it (X-Frame-Options or frame-ancestors), and the browser then shows an empty frame. Under the frame, Open in a new tab opens the page itself.
  • The region's title is the frame's accessible name.

Attributes:

KeyMeaning
heightThe frame's height in pixels, 100–4000 (default 480); the width is the region's
sandboxThe frame's sandbox flags, from allow-scripts, allow-forms, allow-popups, allow-same-origin, allow-downloads, allow-modals and allow-popups-to-escape-sandbox. Default: the first four (most sites need them to work). false: no sandbox. Navigating the whole window (allow-top-navigation) is never allowed
fullscreentrue: the framed page may go full screen (videos, maps)
json
{"height": 640, "sandbox": ["allow-scripts", "allow-same-origin"], "fullscreen": true}

(sprint 140; APEX: Breadcrumb and Help Text regions)

  • breadcrumb: the page's breadcrumb trail as links: the pages above it by their Breadcrumb parent (else the home page), the ones the user may open, then the current page's title ({"current": false} leaves that out). Put it in the Breadcrumb bar position with template plain, which is where the Page Designer's gallery puts one. A page with a breadcrumb region shows the trail only there: its title bar leaves its own out.
  • help_text: the page's Help text (Page Designer → page properties → Help), Markdown with &ITEM. substitutions; item values stay text (no Markdown or HTML of their own). HTML in the help text itself is shown as text, links to javascript: are not links. Without a help text the region says No help is available for this page. (the runtime message region.no_help), or {"empty": "…"}.

HR page 50 (Project team) has both, and two classic reports.

static and dynamic content ​

  • static: source is HTML written by the developer, with &ITEM. substitutions (HTML-escaped). Items placed in the region are rendered below the HTML.
  • dynamic: source is a SELECT; the first column of each row is output as HTML, like APEX's "PL/SQL Dynamic Content". The SQL is trusted, so escape data with meta.html_escape():
sql
select '<ul>' || string_agg('<li>' || meta.html_escape(ename) || '</li>', '') || '</ul>'
  from hr.emp where job = 'MANAGER'

A dynamic region outputs at most max_rows rows (default 1000).

The content security policy blocks inline <script>, event handler attributes, style="…" attributes and <style> blocks in both: use the classes of /static/app.css (for example muted, lead, alert alert-success, tag, btn, cards/card) instead. A browser ignores blocked styles and reports them in its developer console.

Large tables ​

pgkiln is meant for tables of any size. Reports and grids page in the database (limit / offset), so only one page of rows reaches the server; the settings below keep the rest of the page fast too. The HR example's page 25 (Large tables, examples/hr/hr_25_large_tables.sql) shows them on 200,000 generated rows.

Pagination. By default a report shows "1–15 of 2,345", which counts every row the search and filters leave. On a large table that count reads the whole result. With "pagination": "range" (page designer → Report settings → Pagination: Row ranges) the report shows "Rows 1–15" and reads one row more than it shows to know whether there is a next page, like APEX's "row ranges X to Y" pagination. Grids take the same setting.

Keyset paging. An offset still makes the database read and skip every row before the page, so page 8,000 is slower than page 1. A row-range report with "keyset": ["id"] (Report settings → Keyset columns: columns that make a row unique and are not null, ideally the primary key) pages by position instead ("seek" paging): the report is ordered by the user's sort column (if any) and then the keyset columns, and Next and Previous carry the last or first row's values in a signed URL parameter (r<id>_k). The next page is where (id) > ($1) order by id limit 16, which an index answers directly, however deep the page, and rows added or removed meanwhile don't shift the pages. The values are always query parameters; a position that is not signed by the server for this region, sort and page, is too large, or doesn't fit the column's type is ignored, and the report pages with the offset as before. Offset paging is also used without a position (a page number typed in the URL), for a control break, or in the group by, pivot and chart views. Search, filters and sorting work as usual: a new sort or filter starts on page 1.

Maximum row count. "max_rows": 10000 caps what a report reads: its total is counted over at most 10,001 rows ("1–15 of more than 10000"), the pager stops at the last page within the maximum, and the downloads hold at most that many rows. Page numbers beyond it show the last page; the server also limits page numbers (1,000,000) and page sizes (500, grids 200), whatever the URL says.

Row limits. Regions without paging read at most max_rows rows:

RegionDefaultWhen cut off
cards500"Showing the first 500 rows."
chart1000the same note under the chart
dynamic1000
lists of values (an item's max_rows)5000(up to 50,000)

Calendars (2,000 events), maps (5,000 places per layer; 2,000 per visible area, 10,000 per vector tile) and trees have their own limits.

Lazy loading. "lazy": true (report, chart, cards, dynamic, tree and template component regions) sends the page with a placeholder; the browser then fetches the region from GET /a/<alias>/<page>/region/<id> (with the page's query string, so paging and filters apply) and puts it in place. One slow chart no longer delays the whole page. The request is checked like the page: the session, page access, and the region's condition and authorization scheme. Without JavaScript the placeholder is a link that shows the page with the region in it (r<id>_load=1).

Region caching. "cache": {"scope": "user", "seconds": 300} keeps the region's rendered HTML in the server's memory for 1 second to 1 day (same region types as lazy loading):

ScopeShared by
sessionone session
userthe user's sessions
allall users with the same roles

The cache key also holds the application, page, region definition, language, the request's query string and the values of the items the region refers to (and of its own items), so a region is never shared across applications, and a changed region or item value renders anew. A submit of the page empties its cached regions; a dynamic action's Refresh region renders the region anew. Regions whose links carry per-user checksums are not cached for all users, the session's CSRF token is never cached, and a region that shows an error is not cached. A lazy region that is in the cache shows at once. Each server process has its own cache: REGION_CACHE_MAX_ENTRIES (default 1000) and REGION_CACHE_MAX_MB (default 64) bound it, and one region over 2 MB is not cached. Use it for regions that are expensive and may be a little old (dashboards, summaries). In the Page Designer a region's Attributes tab sets both (a report in its settings, the other types in a Caching group), and Utilities → Caching lists the page's cacheable regions with what this server holds, and purges them.

Released under the Apache-2.0 license. Not affiliated with Oracle; Oracle and APEX are trademarks of Oracle.