Press "Enter" to skip to content

Expose a property in Pega


In this post we will see, how we can expose properties in database table.

First let’s get some basics

  • Pega uses properties to hold the data.
  • We can persist the data in database table.

Say for example, I have created a new amazon sales case, Say A-1 and captured all the customer details.

`CustomerName = “Prem”.

We can persist these details in the Work table in a single row that’s corresponds to Case A-1.

Note: Not all the properties exposed as data table columns.

Pega database supports blob storage. If the properties are not exposed, then they get stored in a blob storage column ‘pzpvstream’

So what do you mean by exposing property?

Exposing means, we will be creating a dedicated  column in the database table and map the corresponding property to the database column.

How to expose a property?

Here are some  pre-requisites you need to have in handy!

  1. Have a dedicated work table (or any table) with class mapping done already.

Here my work class will be “OIKGGB-MyKnowPega-Work-AmazonSales” and the table I mapped is


  1. Create new properties in that work class

I got 3 properties in work class – CustomerName, Age and PhoneNumber.

  1. Have a case ready with a flow action to capture the above customer details.

Since I have already exposed Customer Name and Age column for other tutorials, I am going to drop those columns.

My drop column query is like below

Alter Table pc_oikggb_myknowpega_Work DROP COLUMN customername, DROP COLUMN phonenumber.

Now my table is fresh :). No additionally exposed columns.

Now,I am going to explain how to expose the properties.

There are four ways to expose the properties.

  1. Using property rule  form – Optimize using Other actions button
  2. Using Modify Schema wizard.
  3. Directly create a column in database
  4. Exposing properties using declare index rule  – For more info, please visit my previous posts on declare index.

What is Declare index in Pega?


How to configure Declare index in Pega – step by step tutorial

1.Optimize from property form.

Step 1: Open the CustomerName property rule

Step 2: Go to ‘Actions’ button and click on the Optimize for reporting from the dropdown menu.

Step 3: You will be landed in the property optimization landing page

Properties and classes

Here you can get more than one class and the corresponding tables.

Say for example, you have 2 cases in your application and both the cases are mapped to dedicated database table. In such case we can have common properties. When we try exposing those properties, you will get an option to expose those properties in multiple classes and tables.

  • I selected Amazon sales and click on next.

You also have an option to populate the data.

Populating data – Whenever, we expose a property in later point of time, we can use column population jobs to copy the data from the blob storage to the exposed column. We will see more in detail in separate lesson 🙂

Population schedule – Now/Later

If you choose later, you get an option to specify the date and time.

Normally column population job invoves in updating the database table records. So in higher environment, we can schedule to run this job during offline hours.

Eligible classes

  • You will get a screen with a confirmation warning. It will list all the classes that will be affected.
  • You can click next to start optimizing.


You can also click on the Column population jobs dashboard, to check the job status

Now, let’s check the database table, if a new column is created or not.

Yes :). Create a new case and check if the customername is getting populated.

I have created a case A-6. Check in the database table for pyid =’A-6’.

We have successfully optimized the customername property.

Note: Optimise property action is available only for single value property. Also, a when rule ‘pxIsPropertyOptimizationAllowed’ should be true. If you dig the when rule, then you can see two conditions must be satisfied.

  1. Dynamic system setting – database/AutoDBSchemaChanges should be true

  2. Operator should contain the privilege ‘SchemaPropertyOptimization’ in his access rule.

Procedure 2

Here I am going to try optimizing Age property

  • You can make use of the Modify Schema wizard.

Designer studio -> System -> Database -> Modify Schema

You can see a 6 step wizard.

Step 1: Select a database.

Choose an available database.

I selected PegaDATA , where my work table is available

Step 2: Select a Table

Select the appropriate table from the database.

I selected pc_OIKGGB_MyKnowPega_Work, which is my work table.

Step 3: View table

You can view the contents of the table.

Click on the count of columns link inside the grid to view the properties – Step 5

Step 4: View columns. You can also directly click on view columns or Columns in the table : (92)

Just a read only view and you can come back.

Step 5: View properties.

  • You can see the exposed properties – Already greyed out
  • Unexposed (eligible) properties – You have an checkbox option to select those eligible properties.

Eligible refers to column visibility field :). We will see in detail.

You should get a question here!. Why Age property is not an eligible property?

Actually you need to check a configuration point in property rule form

Step 1: Open the age property.

In the advanced tab, you have a filed – column inclusion.

You have 3 options.

  1. Required / Recommended – selecting this will make this property as a candidate to optimize
  2. Optional – this is equal to making this field as empty.

Here I selected –Required.

  • Now again continue the modify schema wizard.

You will see the Set to visible  count increased from 102 to 103.

Click on the link to view the properties.

You will the age property. Select the property.

Scroll down.

  • You can either generate the SQL code or directly generate the database columns.

To generate the database columns, you need the database User ID and password.

If you are using personal edition provide ‘pega’ as user name and password.

  • Click on create.

You can see the success message.

Now let’s go and check the database table.

You can see a new column Age got created.

Note: The operator should contain ‘SchemaPropertyOptimization’ privilege to use wizard.

Procedure 3:

Here I am going to expose ‘phonenumber’ property.

Step 1: You can directly create a new column using SQL developer ( may be with the help of DB team)

You can run the query and check in the database table.

You can see the newly added column Phonenumber.

Note: After adding a new column, always re-save the database table instance. (This re-save will be handled by the wizard, when we expose the property from designer studio)

Let’s create a new case with valid phonenumber and check the value in database table.

  • The case I created is A-8.

Let’s check the phonenumber value in database table.

We have successfully exposed 3 different properties via 3 different procedures 🙂

Why do we expose a property?

  1. The main aim is to support reporting.

Say for example, I need to make a report and display all the customer details like ‘phonenumber, age & name’. here if I don’t expose those columns, then I need to decrypt the Blob and get their values. This is very expensive and degrades performance. Also you cannot use SQL query. SQL query can access only the exposed columns. This is the main reason why we expose the properties.

  1. Also keep in mind that, exposing large number of columns also degrades performance. So use it wisely.

We will see more about column population job in my next post 🙂

I will come up with a new post very soon 🙂




  1. Shivakumar Shivakumar

    Hi prem,
    Good info.
    after creating new column in new table we need to add property in class collumn mapping tab right?

  2. Once I expose a property, would I have the value of that property in the exposed column as well as in the blob?

  3. Pradeep Pradeep

    Good post PREM.

    I want to clear two things.
    1. Decrypt the blob?

    2. SQL query(regarding which query) can access only exposed columns

  4. Gupta Gupta

    Thanku Prem. Very helpful. Can you please explain Report Def..

    • Premkumar G Premkumar G

      You are welcome, Gupta. 🙂
      Yeah I’ll post about it soon. More new posts are on the way. Stay tuned. 🙂

  5. Rupesh M Rupesh M

    Hi Prem,

    can you please give some information on the column Inclusion ->”Optional”

    You just mention here as this is equal to making this field as empty .

    what does it means? Do u mean Always the value of that property will be empty in the data base?

    if so what is the purpose of it ?

    Rupesh M

  6. Adarsh Adarsh

    Hi Prem,

    Nice work, clearly explained.. keep up the good work 🙂

    i have small doubt.

    if one class is already mapped to some table and if we create the new class and same properties in the new class(which was present in the old class), and mapped to same table. do we need to expose those newly created properties ?


  7. Sushil Sushil

    Hi Prem ,

    Very good explanation.

    Can you please post article on OAUTH security implementation.

    • Premkumar G Premkumar G

      Hi Sushil,

      Thank you so much. 🙂
      Yeah I’ll post about it soon. Stay tuned. 🙂

  8. Kethan Kethan

    Thanks a lot for your effort on posts.

    • Premkumar G Premkumar G

      You are most welcome, Kethan. 🙂

  9. Raj Kumar Raj Kumar

    Hi Prem,
    Its really excellent articles and the way of your explanation. I have one doubt here. Plz clarify.
    In Declare Index concept, you have explained, there is a Address page property that have Street, City and State you have created index for those properties instead of that can we expose that properties. What is the diff b/w Exposing and declare index. In this topic you have directly exposed rite then instead of that can we create Declare Index..?

  10. Kiran Kiran

    Hi Prem,
    Its really excellent articles. I have one doubt here. Plz clarify.
    In Declare Index concept, you have explained, there is a Address page property that have Street, City and State you have created index for those properties instead of that can we expose that properties. What is the diff b/w Exposing and declare index. In this topic you have directly exposed rite then instead of that can we create Declare Index..?

  11. Aziz Aziz

    Hi Prem,

    Thanks for the post. i have a query here.

    Can we expose valuelist property?
    and post how to expose pagelist property also.


  12. sam sam

    really good post. nice

    • Premkumar G Premkumar G

      Thank you so much, Sam. 🙂

  13. Pradeep Pradeep

    Hi Prem,

    Thanks for sharing here, will keep following your posts.
    Totally a nice deep understanding presentation.

    • Premkumar G Premkumar G

      Hi Pradeep,

      You are most welcome. 🙂
      Thank you so much for your appreciation. Stay tuned for new posts. 🙂

  14. amir amir

    Great site and great articles. Keep it coming.

    Can you please post some articles on page context and flow routing (worbasket, worklist) advanced stuff.


    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Amir. 🙂
      I’ll keep on posting new stuffs. Stay tuned. 🙂
      Yeah, I’ve noted those down. I’ll try to post about them as soon as possible. 🙂
      You are welcome. 🙂

  15. Prasu Raya Prasu Raya

    Really, superb detailed explanation with good example. Thank You so much for your efforts

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Prasu. 🙂 Glad to hear that you like it.
      You are most welcome. 🙂

  16. mohammed faijas mohammed faijas

    very good explanation.
    Can we somehow give the size of column to be created while exposing the property from property option ?

    • Premkumar G Premkumar G

      Hi Faijas,
      You can always update the column size using SQL developer. I don’t think you can control it when optimizing

  17. Krishna Chaitanya Krishna Chaitanya

    Nice Explanation…

    • Premkumar G Premkumar G

      Thank you so much, Krishna. 🙂

  18. Krishna Chaitaya k Krishna Chaitaya k

    Great Explanation with good examples , always will keep following your posts !!

    • Premkumar G Premkumar G

      Thank you so much for your appreciation, Krishna. 🙂
      Glad to hear that you like it. 🙂

  19. Laasya Laasya

    Detailed explaination 🙂 I have a query. What is the main advantage of exposing the property? I understand that performance will be impacted once the column are exposed.

  20. Dharma Dharma

    Nice explanation, Good post – Prem

    • Premkumar G Premkumar G

      Thank you so much, Dharma. 🙂

  21. Laasya Laasya

    Detailed explanation 🙂 Can you elaborate on the advantage of exposing a property? Is it only for the performance exposing property is done?

  22. kv kv

    nice post.if u can post exposing page list properties..that would be great.

  23. Siva Siva

    Can You also post on exposing embedded data i.e. pagelist

    • Premkumar G Premkumar G

      Yeah, I’ll post about it soon. 🙂 Stay tuned. 🙂

  24. Suresh Suresh

    Clear Explanation Prem,can you please post Routing,WorkBaket and Worklist Related Things..

    • Premkumar G Premkumar G

      Thank you, Suresh. I’ve taken note of those topics, I’ll post about them soon. Stay tuned. 🙂

    • Premkumar G Premkumar G

      Thank you, Suresh. 🙂
      I’ve taken note of those topics. Stay tuned, I’ll post about them soon. 🙂

  25. murali murali

    Extrordinay prem

    • Premkumar G Premkumar G

      Thank you so much, Murali. 🙂

  26. RK RK

    Declare Indexes should also be covered here as they also expose properties for reporting

  27. Surya Surya

    This blog is just amazing, keep up the work. thanks for you time in making us learn PEGA in easy and better way. my request here is to learn all about the activities and in what circumstances we use the Step Pages and so.. 🙂

    It will also be helpful if you can let us know the upcoming topics somewhere in the website and the estimated arrival of the post, so that we can keep a track of them 😉

    Thanks a lot 🙂

    887 Subscriber – Sorry for the late. 🙂

    • Premkumar G Premkumar G

      First of all. Thank you so much for your appreciation, Surya. I’m feeling so much happy that you are finding it useful. 😀 Hope you learn everything you wanted to learn here.
      I’m thinking about posting the upcoming topics like a flashing display somewhere. I’ll try to post it soon. 🙂
      Stay tuned. 🙂
      You are most welcome, Surya. 🙂
      No worries bro. 🙂

  28. Rajasekhar Reddy Rajasekhar Reddy

    Nice Explanation Prem.

    • Premkumar G Premkumar G

      Thank you so much, Rajasekhar Reddy. 🙂

  29. Krishna Krishna

    Nice explanation 🙂

    Is there a way to check what are all the properties available inside pzpvstream blob column using, Database select query (in back end).

  30. RK RK

    There is no mention of BIX here.

    • Premkumar G Premkumar G

      Hi RK,
      BIX can make use of properties which are not exposed. I find it is not relevant to this topic 🙂
      I will try to make a separate post on BIX soon

  31. Mamta Mamta

    Can you also explain how are the optimized properties handled at the time of deployment to other environments

  32. RK RK

    Thanks Prem. U nailed it .We are expecting more posts from you. Please explain the concept of work, cover and folders.

  33. Rakesh Rakesh

    Nice Explanation Prem, Can you please suggest me when exposing a property what are the rules it will create?

  34. Sriram Karumuri Sriram Karumuri

    Very nice explanation. How can we include the alter query in rap to migrate to higher environments. I do not want to manually take the query and execute rather want to use Jenkins to deploy table expose columns.

  35. Biman Nandi Biman Nandi

    Hello Prem,

    I want to thank you so much for your posts which makes easier to learn pega and concepts clear. The way you represent is so easy to understand the same and the actual pega rule screen shots adds a huge to understand it even better.
    Please keep on posting to cover more topics.


    • Premkumar G Premkumar G

      Hello Biman Nandi,

      You are most welcome. Thank you so much for your heartfelt appreciation. It really makes me happy.
      I’ll keep on posting more topics. Stay tuned.

      Premkumar G

  36. Ankit Ankit

    Hi Prem,

    Is there any difference if we expose a property using a query (Procedure 3) and exposing using optimization (Procedure 1)?

  37. Ankit Ankit

    Hi Prem,

    Is there any difference if we expose a property using a query (Procedure 3) and exposing using optimization (Procedure 1)?


  38. Lakshman Lakshman

    Good site.
    Why we are using property optimisation?

  39. Nisith Nisith

    Hi Prem,

    Firstly thank you so much for this awesome post I really loved the explanation.
    And secondly I would like to know that if i have exposed a column by any of the first 3 process will it update the data for the old cases that is already present in the db as well?? If not then what is the resolution for that…

  40. sai chaitanya sai chaitanya

    Thank you Prem!!!
    Got a clear picture..

    • sai chaitanya sai chaitanya

      Can you Please explain on Debugging tools?

  41. PreethiKa PreethiKa

    Hi Prem,

    When i try to “optimize for Reporting”, i got a message stating “unable to perform property optimization. The containing class is Abstract”.

    Can you please explain about Concrete and Abstract class.

    • Premkumar G Premkumar G

      Hi Preethika,
      I will try to make a post on Classes and Class groups soon. To be precise, concrete classes can only contain instances.
      You tried from property rule form – other actions right?
      If yes, then i property should come under some concrete class path hierarchy.

      For example – you have a concrete class AIG-IG-Work and I defined the property xyz in AIG-IG which is a abstract class. In this case, when you optimize the wizard will give you an option to optimize for the above parent AIG-IG-Work class.
      If your AIG-IG-Work is also a abstract class ( obviously work classes will not be abstract :)) then you may get the above error
      Follow the link for more details

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!