Configuring a basic data object
Speed up application development by creating data objects that collect related information into reusable entities. By using data objects, you can simplify your data structure for easier reuse across interfaces.
For more information about data objects and other key data integration elements, see Basic concepts in data modeling.
The following video provides a visual walkthrough for configuring basic data objects:
The following sections provide a detailed step-by-step guide:
Adding data objects
Create a data object that is a template for a reusable entity.
Every data object consists of one or more fields that share the same context and function. A sales application, for example, might include a Customer data object that manages personal information that you need to collect from your customers to complete orders.
- In the navigation pane of App Studio, click Data.
- Click Add data object.See the following figure for reference:
- In the Create data object window, enter the data object name.
- Click Next.
- In the Connection details window, accept the default
settings by clicking Submit, as shown in the following
figure:For more information about the available data object sources, see Creating a data object.
Defining data objects
Capture various types of information that define a data object by adding fields.
In the Customer data object, you can define fields to collect personal information of your customers such as First Name, Last Name, Full Name, and Phone Number.
- In the data object that you created, on the Data model tab, click Add field, as shown in the following figure:
- In the Add field window, specify the field details:
- In the Field name field, enter First name.
- In the Type list, select Text (single line).
- Click Submit & add another.
- Repeat step 2 to add the following fields:
- Field name: Last name, Type: Text (single line)
- Field name: Phone number, Type: Phone
- Click Add field.
- In the Configure field window, specify the field
details:
- In the Field name field, enter Full name.
- In the Type list, select Text (single line).
- Expand the Advanced section.
- Select the This is a calculated field (read-only) checkbox.
- In the Calculation field, select Use expression.
- Combine the first and last name values to create a full name, as shown in the following figure:
- Confirm your settings by clicking Submit.
- Save the data object.The following figure shows a sample Customer data object with several fields that capture various types of basic information:
Adding fields that require input
Adding calculated fields
Adding records to data objects locally
After you define a data object, you can store the related data records locally, in the Pega Platform system of records, without having to create or maintain database tables.
For example, you can create records that store data for each individual customer, as you defined in the Customer data object.- In the navigation pane of App Studio, click Data.
- Open a data object that has Pega configured as the system of record, as shown in the following example:
- In the data object, click the Records tab.
- Click Add records.
- Provide values for the fields that you configured, as shown in the following example:
- Optional: To add more records, repeat steps Configuring a basic data object through Configuring a basic data object.
- Save the data object.
Reusing data objects
As your application evolves, you can quickly expand the amount of information that your data object captures by referencing other data objects.
For example, you can use data objects from another application layer.
When data object A
references data object B,
the fields from data object
B
become part of data object A.
You can reuse data objects multiple
times.
Consider an example in which a company needs to capture shipping addresses in addition to basic customer data as a result of changing business requirements.
You can reference the Shipping address data object from the Customer data object as embedded data to reflect user-supplied information from a case type, as shown in the following figure:
Reuse an existing data object to broaden the scope of information that another data object requires to capture.
- In App Studio, open the data object that you want to modify.
- On the Data model tab, click Add field.
- In the Add field window, enter the field name.
- In the Type list, select Embedded data.
- In the Data object list, select the data object you want to reference.
- Optional: To modify the default field ID of the referenced data object, expand the Advanced section, and then edit the ID value.
- Optional: To provide additional information about the field, expand the
Advanced section, and then complete the
Description field.The following figure shows a sample data object reference:
- Confirm your settings by clicking Submit.
Creating views in data objects
You can take advantage of the data objects that you configured by reusing them to speed up the creation of case views.
Views act as building blocks for user interface forms, and support reuse across the application. For more information, see Forms and views.- In App Studio, open the data object that you want to use as a source for a view.
- Click the User Interface tab.
- On the Views section, click Add.
- In the Create new view window, specify the basic view
details:
- Enter the view name.
- Select the view template.
- Confirm your settings by clicking Submit.
- Add fields to each region that corresponds to the view template that you
selected:
- In the Edit view section, in a Region area, click Add to add fields to the view.
- Select each field that you want to add to the view, and then click Add.
- If your data object references other data objects as data relationships, add
fields from these data object to your view:
- Click the Gear icon next to the referenced data object whose fields you want to add to the view.
- Optional: To edit the default view template for the referenced data object, in the Template section, click Edit, and then select a view template.
- Add fields to each region that corresponds to the view template that you selected.
- When you finish adding fields to your view, save the data object.
Previous topic Basic concepts in data modeling Next topic Fields as building blocks for data objects