APEX tip 001: Masking & merging columns on Interactive/classic reports

Column Masking

When you want to mask sensitive data on an APEX interactive or classic report; use this on the SQL query fetching the data on your tables or views.

rpad(substr(columnName,1,5), length(columnName),'*') columnName 

SQL query example:

select CONTACT_FIRST_NAME, CONTACT_LAST_NAME, rpad(substr(CONTACT_EMAIL_ADDRESS,1,5), length(CONTACT_EMAIL_ADDRESS),'') EMAIL,rpad(substr(CONTACT_BUSINESS_PHONE,1,6), length(CONTACT_BUSINESS_PHONE),'') PhoneNo , CONTACT_CITY, CONTACT_COUNTRY from contacts_view

Results:

Merging two columns:

The above report has two columns for Name -> “Contact First Name” and “Contact Last Name”

Merge the columns using SQL query on Oracle Database; ie.

select CONTACT_FIRST_NAME || ' '|| CONTACT_LAST_NAME as NAME, rpad(substr(CONTACT_EMAIL_ADDRESS,1,5), length(CONTACT_EMAIL_ADDRESS),'') EMAIL,rpad(substr(CONTACT_BUSINESS_PHONE,1,6), length(CONTACT_BUSINESS_PHONE),'') PhoneNo , CONTACT_CITY, CONTACT_COUNTRY from contacts_view
 

Results:

Try apex using the Always Free Tier Oracle Cloud!

Cheers!