Thursday, December 3, 2009

APEX: Substitution Strings

Home --> Workspace --> Application Builder --> Substitution Strings

I was asked a question the other day about substitution strings. Like many things, I did not know all of them off the top of my head. But I do know where to find them.

A trick I used to use was to create a page with an HTML Region and put all the substitution strings in there...just so I could remember them.

In an HTML Region, the syntax is
Here's the list of all the substitution strings supplied by APEX in (just cut and paste this into your Region Source):
<b>APP_ALIAS</b>: &APP_ALIAS.<br>
<b>APP_ID</b>: &APP_ID.<br>
<b>APP_PAGE_ID</b>: &APP_PAGE_ID.<br>
<b>APP_USER</b>: &APP_USER.<br>
<b>DEBUG</b>: &DEBUG.<br>
<b>HOME_LINK</b>: &HOME_LINK.<br>
<b>LOGIN_URL</b>: &LOGIN_URL.<br>
<b>REQUEST</b>: &REQUEST.<br>
<b>SQLERRM</b>: &SQLERRM.<br>
And here's what it looks like when you run the page:

You can also create your own custom substitution strings. First, go to your application home and then click on the link shown below:

So you don't have to see the entire page, just click on the "Substitution" filter:

Then add your own, it's a key/value pairing similar to static LOVs

Add that to your Region Source, run the page and voila!


Louis-Guillaume Carrier-B├ędard said...

You can do the same with application items.

oraclenerd said...

Good point sir!

Might as well add Page Items as well.

Sue said...

Is there anyway to SET a substitution string in an anonymous PL/SQL block?

TechneTalk said...


Assume your substitution string is MY_SUBS.

You can use it in an anonymous PL/SQL block as :MY_SUBS