Conversation
Pegasystems Inc.
GB
Last activity: 14 Oct 2025 11:26 EDT
Data Level Attachments
In Pega, you can attach files and other documents to a case at various levels of the data model, not just at the top-level case. This allows for more granular control and organization of attachments within a case structure. You can add attachment fields to any level of the data model, including nested data objects or data pages, enabling you to associate files with specific data elements. You can define your field as a single attachment or a list of attachments. A screen with data level attachments is shown below.
Key Concepts:
-
Data Model: Pega's data model allows for hierarchical structures, meaning you can have nested data objects within a case.
-
Attachment Fields: These are fields you define within a data class or data page that allow users to upload and attach files.
-
Attachment Categories: These categorize attachments, helping with organization and access control.
-
Access Control: Pega allows you to configure access control at the attachment level, specifying which users or groups can access specific attachments.
Benefits of Data Level Attachments:
-
Improved Organization: Attachments are associated with specific data elements, making it easier to find and manage related documents.
-
Granular Access Control: Control who can access specific attachments based on their role or data context.
-
Contextual Attachments: Attachments are directly related to the data they describe, providing a more intuitive user experience.
-
Document Storage: Approach continuhttps://docs.pega.com/bundle/platform/page/platform/case-management/sou… to work with existing configuration for document storage (Pega or External).
-
See Document storage
Notes:
- Pega Platform already allows attachments at the top case level, and now you can also add them at the lower levels of the Case Data Model.
- Attachment fields can be used in an embedded page only if embedded in a case at any level. Attachment fields can't be used inside the hierarchy of a standalone data record.
Business Scenario: Mortgage Application
ABC bank supports up to 4 people in a mortgage application. The bank wants to capture details of each applicant along with their proof of Identification (Passport or Driving License), Address (Utility Statement, Council Tax statement or Bank Statement) and Income Proofs (Pay-slips or Bank Statements for the last 2 months)
Solution Approaches:
The traditional way to capture documents is to attach them to the Mortgage case with relevant categories. Since all documents are attached to the case, documents related to each applicant are usually prefixed or suffixed with applicant's name or initials to distinguish between them.
With this new capability, attach documents at any level within the case data model, we can handle attachments more efficiently. See Adding attachment fields
How it works at a high level:
1. Define Attachment Fields: You can add attachment fields to any class, including data classes, to allow users to upload attachments.
2. Choose Attachment Type: You can select whether to allow a single attachment or a list of attachments for that field.
3. Associate with Data: The attachments are linked to the specific data instance where the attachment field is defined. For example, if you have a data class for "Employee" with an attachment field for "Resume", the resume will be associated with a specific employee record.
4. Configure Access: You can configure access control at the attachment category level or even at the individual attachment level.
5. View and Manage: Users can view, download, or delete attachments through the Pega UI, and administrators can manage the attachments based on access control configurations.
Solution Approach 1: Attach documents to Applicant Data Object
Instead of attaching all documents to the Mortgage case, we can attach applicant specific documents to the respective applicant data object record. This will help us to easily locate the documents associated with each applicant. Moreover, we can differentiate the types of documents using the attachment field type. In this example, we are going to create 3 attachment fields (ID, Address, and Income). This will allow us to configure different business rules for each of them.
1. Create a Data Object called Applicant with the following details (Refer Screenshot below)
Name (Text)
Type (Primary, Secondary)
Date of Birth (Date only)
Proof of ID (Attachment)
Proof of Address (Attachment)
Proof of Income (Attachments)
2. Create an embedded field called Applicants of type Applicant in the Mortgage case
3. Create a Form view to capture the applicant details and documents
4 .Restrict file types for each of the attachment fields to better data quality
5. Add conditions to ensure that a minimum of 1 and maximum of 4 applicants are added
6 At runtime, documents for all applicants can be attached in a single place along with other details. If multiple attachments are allowed for a field, then the count of attached files will be shown (e.g. Proof of Income below). Clicking on the count link will allow the user to view the individual documents
Note: The attachment count in the utility widget is ‘0’ as these documents are not attached to the case directly. Only case level attachments count will be shown here
7. Can preview, delete and download attachments during Document upload
8. Can preview, delete and download attachments as per the security settings in another step. (In the screenshot below delete option is not allowed)
9. You can preview the document by clicking on the document. Please note that only certain file types are supported (e.g. jpg, jpeg, pdf, mp4, m4v, etc.). Unsupported file types can be downloaded and can be opened using the respective viewers (e.g. .doc using MS word)
Solution Approach 2: Use a Document data object
In this approach we are creating a dedicated data object to store documents and all its key attributes. This will help us to manage the documents more efficiently by using the associated attributes. For instance, we can track the expiry date of documents and initiate business processes/workflows based on that. Similarly, we can create an approval workflow for all documents. Another benefit of this approach is that we can see all the documents related to the Mortgage application case in a single place
1. Create a Data Object called Document with the following document specific attributes
Number (Text)
Type (Passport, Driving License, Utility, Council Tax, Bank Statement, Pay-slip)
Category (Identification, Address, Income)
Valid From (Date only)
Expiry Date (Date only)
Document File (Attachment)
Approved by
2. Create a Data Object called Applicants with the following details
Applicant Name (Text)
Type (Primary, Secondary)
Date of Birth (Date only)
Address (Text)
Documents (Document)
3. Create a view to capture applicant details along with the documents
-
Create an embedded field called Mortgage applicants of type Applicants data object.
4. Configure the Mortgage Applicants field as shown below
5. Run time view is shown below
Summary:
We have seen 2 ways of handling the documents more efficiently by making use of the new ability to attach documents at any level of the case data model. By associating attributes (e.g. expiry date) to the attachments, we can easily build business processes around the attachments like any other field. So, make use of this new capability while designing solutions involving attachments to serve customers better.
Constellation 101 Series:
Enjoyed this article? See more similar articles in Constellation 101 series.