Skip to content
Richard Šenko

Oracle APEX Quick Tip: Passing Values Containing Commas in a Branch

A small Oracle APEX URL escaping detail that matters when a branch needs to pass a comma-separated value as a single page item value.

Recently, I needed to pass a list of generated document numbers from one Oracle APEX page to another:

600380776,600380777,600380778

The value was stored correctly in the source page item:

P10_DOCUMENT_NUMBERS

and the branch was configured to pass it to:

P20_DOCUMENT_NUMBERS

At first, the obvious value to use in the branch was:

&P10_DOCUMENT_NUMBERS.

The problem is that commas have a special meaning in Oracle APEX URL syntax. They are used as separators between item values, so a comma-separated string may not be treated as one value.

Contents


Passing the value as one item

The fix is to wrap the value in backslashes:

\&P10_DOCUMENT_NUMBERS.\

In the Branch Set Items configuration, I used:

Item:
P20_DOCUMENT_NUMBERS

Value:
\&P10_DOCUMENT_NUMBERS.\

The target page then receives:

600380776,600380777,600380778

as one value in:

P20_DOCUMENT_NUMBERS

Where the same issue can happen

The same issue can appear anywhere APEX constructs a page URL, for example:

  • Branches
  • Buttons using Redirect to Page
  • Links created with Link Builder
  • Manually constructed f?p URLs

If a value contains commas and unexpectedly gets split while navigating between pages, check the URL escaping first.

The pattern to remember is:

\value,with,commas\