Tag: ai

  • Pega Constellation Data Modeling: Step-by-Step Guide

    Pega Constellation Data Modeling: Step-by-Step Guide

    FILES:

    Data model design
    Countries Catalog

    In this guide, we’ll walk through how to design and build a complete Customer Data Model in Pega Constellation.
    You’ll learn how to:

    • Create data objects from scratch
    • Establish relationships between objects (embedded and referenced data)
    • Upload external catalogs (CSV) into Pega
    • Visualize the full data model
    • Reference the data model inside a case type

    This tutorial mirrors exactly what was built in the video—perfect for beginners learning Pega Constellation’s data model capabilities.


    1. Designing the Data Model

    Before using App Studio, it’s important to outline the structure.
    Our Customer object will contain:

    Customer Fields

    • Name
    • Email
    • Phone (list of phone records)
    • Address (single address record)
    • Products (list)
    • Nationality (reference to a Country catalog)

    Supporting Data Objects

    To support the customer entity, we will also create:

    • Phone
    • Phone Types (Home, Mobile, Work)
    • Address
    • Address Types (Home, Work)
    • Products
    • Country Catalog (CSV uploaded from GitHub)

    Each of these will be modeled as a Data Object inside Pega Constellation.


    2. Creating the Customer Data Object

    1. Navigate to App Studio
    2. Click New → Data Object
    3. Name it Customer
    4. Choose Local storage
    5. Click Submit

    Your object is now created.
    Next, we’ll add all fields using the Data Model Visualizer.


    3. Adding Fields to Customer

    Open the Customer data object and add:

    Name

    • Type: Text (single line)

    Email

    • Type: Email

    Phone

    This field is an embedded data reference to a new list-type data object we’ll create.

    Address

    Another embedded data reference to an Address data object.

    Nationality

    This will be a picklist that retrieves records from the Country catalog (CSV).

    Products

    A list of product items (you can replicate the same steps as the Phone object).

    We’ll configure the Phone, Address, and Country objects next.


    4. Creating the Phone Data Object

    1. Click New → Data Object
    2. Name it Phone
    3. Choose Local
    4. Add the following fields:

    Phone Type

    • Type: Data Reference
    • Points to: Phone Types data object
    • Mode: Single record

    Phone Number

    • Type: Phone

    Save the object.


    5. Creating Phone Types (Dropdown Source)

    1. Create a new Data Object named Phone Types
    2. Add one field:
      • Type (Text)
    3. Go to Records and add the allowed values:
      • Home
      • Mobile
      • Work

    These values will appear automatically as dropdown choices thanks to Pega’s auto-generated data pages.


    6. Creating the Address Data Object

    1. Create Address as a new Data Object
    2. Add:
      • Address (Text)
      • Address Type (Data Reference → Address Types)

    Create Address Types

    1. Create Address Types Data Object
    2. Add a Type field (Text)
    3. Add records:
      • Home
      • Work

    7. Creating and Uploading the Country Catalog

    We’ll use a CSV catalog from GitHub containing:

    • Country Name
    • Alpha-2 Code
    • Country Code (numeric)

    Steps to import:

    1. Create a Data Object named Country (or CountryCode)
    2. Add three fields:
      • Name
      • A2
      • Code
    3. Click Import
    4. Upload the CSV file
    5. Map the columns
    6. Validate and import

    Pega will automatically create the data pages that expose these records.


    8. Adding Nationality to the Customer Object

    Inside Customer:

    1. Add a new field: Nationality
    2. Type: Picklist
    3. Data Page Source: Country list data page
    4. Display Field: Name

    This will display the country name and reference the selected record.


    9. Visualizing the Data Model

    Open the Data Model Visualizer to confirm relationships:

    • Customer → Phone → Phone Types
    • Customer → Address → Address Types
    • Customer → Nationality → Country Catalog

    This visual map helps guarantee your data structure is correct before adding views.


    10. Referencing the Data Model in the Case Type

    To make the Customer object available inside a case:

    1. Go to Case Types
    2. Select the case (e.g., KYC Customer)
    3. Open the Data Model tab
    4. Add a new field:
      • Name: Customer
      • Type: Embedded Data
      • Data Object: Customer
      • Mode: Single Record

    Now the case can create, store, and use the entire Customer data model.


    What’s Next?

    In the next tutorial, we will:

    • Build the views and forms
    • Bind fields to the UI automatically
    • Display dropdowns powered by our data pages
    • Save Customer data during case processing

    Pega Constellation automates data pages, relationships, and field behavior—making data modeling faster and easier than traditional Dev Studio.

  • How to save a Page List into data type, Pega Tutorials

     Hi All, recently I had some troubles saving a list into a data type, that is something that I have never done before and there is so little information about it in the pega community sites, so let’s get this done 

    to start you have to create a data type and have records on in, if you don’t know how to do that, you can watch this video explaining step by step how to create a data type https://youtu.be/rYex_UsTtMg .

    The next thing that you will need is a page list property, when you are creating the page list property in page definition you have to add the class of the data type. 

    Once we create the page list the easy way to add records to it is through a table so on your section you can configure a table

    to configure a table select property on general than in order to add data, on table settings click on Operations and in row editing select inline and then click the row to edit and submit  

    save the section and test by adding some data to it, you will get something like this :

    You can check your list on the clipboard:

    Now that we have the list the next step will save it into the data type, I had some struggle at the beginning because i tried to do the logic in the data page, for some cases is very useful to map the data using a response data transform that is good when you have a to map values one to one, in this case, i will solve using and activity outside the data page, this activity you can call it from a button, flow action, utility shape in the flow where ever you need it according to your logic, for this example i will use it on a button

    The first step to creating the activity is to analyze the list that you are trying to save, to define the loops 

    that is very important because sometimes we have a page list inside a page 

    I will explain the creation by steps into the activity  

    Step 1

    On the step one we click on Loop then we select the option “for each embedded page” leave the class empty and then click on submit. then on the step page we put the page list property where we want to make the loop 

    step 1.1

    We create a new page, Whe use the method page new to do it and this is very imoportant and the reason that i almost loose my head, because i only get to save the first record of the list and it was because i missed this step, every time that we make a loop we need a new page to save the record otherwise you will be overwriting the data.  so in pages an clases tab we define the class of the data type, then on the step page we use the page that you saved 

    Step 1.2

    on this step we do a maping of the data that we want to save using the method Property-set 

    since we are on the context of the customerList porpery we need to reference the properties from the data type

    Step 1.3

    On this step we use an object save and on the step page the page for our data taype class, it will save every iteration of our list and that will be the last step 

    so tour activity should look like this 

    Lest try it 

    now i called from a button and when we run it all the proceses in the backgorund when we trace the activity looks like this: for each page list it will save the values 

    Troubleshooting 

    if by any Chance you encounter problems and it not saves, check this 

    The Key of the page, open the class of your data type and if the key is not auto generated you will have to pass the key in order to save a new input, you can create a unique ID using  this function if you need it CreateUniqueID() 

    If you still have issues saving, please check on the obj-save step expand it and check write now checkbox

    if you are not able to get this to work please comment and i will help you, Hope it works for you:)