Retrieving customer data
If one of your customers requests that you provide them with all data you collected about them, you can run an activity that retrieves all data about the customer from Pega applications. Data about Staged Decisions, Interaction History and Customer Movie is retrieved from the pxDecisionResults, pxStrategyResults, and pxEventStoreResults data sets. For Pega Platform 7.3 and later, you can download a ruleset that contains the activity from Pega Marketplace. For earlier Pega Platform versions, you need to manually create the activity.
- Optional: Downloading the PegaCustomerDataPrivacy ruleset.
- Optional: Creating an activity to retrieve customer data.
- Running the activity to retrieve customer data.
Optional: Downloading the PegaCustomerDataPrivacy ruleset
The PegaCustomerDataPrivacy ruleset contains predefined activities that help you manage customer data to implement your own compliance strategy. You can download the ruleset from Pega Marketplace and import it into your application.
- Download the component Pega GDPR Compliance for Decisioning and Marketing from Pega Marketplace. This component contains the PegaCustomerDataPrivacy ruleset.
- Log in to your application as an administrator.
- Click Designer Studio > Application > Distribution > Import.
- Follow the import wizard and import the PegaCustomerDataPrivacy ruleset.
- After the import finishes, click App. In the search field of the App Explorer, enter Data-.
- Click Technical > Activity and verify that you can open the activity RequestCustomerData.
Optional: Creating an activity to retrieve customer data
For Pega Platform 7.2.1 and 7.2.2, to retrieve customer data, you must manually create an activity in your application ruleset. For more information about creating custom activities, see About Activities.
The activity that you create must be able to request data from the following data sets:
- pxDecisionResults (Staged Decisions)
- pxInteractionHistory (Interaction History)
- pxEventStore (Customer Movie)
pxDecisionResults (Staged Decisions)
To request data from pxDecisionResults, configure the activity's Steps page.
- Line 1
- Method – Page-New
- Step page – CustomerData
- Line 2
- Method – DataSet-Execute
- Method Parameters
- Data Set – pxDecisionResults
- Operation – Browse by keys
- Key – pxSubjectID
- Value – Param.customerId
- Store results in – CustomerData.pxResults
- Line 3
- Method – Property-Set
- Step page – CustomerInfo
For an example of this configuration, refer to the following image:
This allows the activity to search for decision results to retrieve by using a key, which in this example, is the ID of the customer.
pxInteractionHistory (Interaction History)
To request data about Interaction History entries from pxInteractionHistory, configure the activity's Steps page.
- Line 1
- Method – Page-New
- Step page – CustomerData
- Line 2
- Method – DataSet-Execute
- Method Parameters
- Data Set – pxInteractionHistory
- Operation – Browse by keys
- Key – pySubjectID
- Value – Param.customerId
- Store results in – CustomerData.pxResults
- Line 3
- Method – Property-Set
- Step page – CustomerInfo
For an example of this configuration, refer to the following image:
This allows the activity to search for Interaction History entries to retrieve by using a key, which in this example, is the ID of the customer.
pxEventStore (Customer Movie)
To request data about the Event Summary for a customer, use the Property-Set method with the following Method Parameter:
- .EventStoreResults – D_pxEvents[customerId:Param.customerId,startTime:"19700101T000000.000 GMT",endTime:@(Pega-RULES:DateTime).CurrentDateTime()].pxResults
This allows the activity to search for all events for this customer, regardless of the time frame.
Running the activity to retrieve customer data
- Log in to Designer Studio.
- Search for and open the activity that retrieves customer data. This can be the activity that you imported with the PegaCustomerDataPrivacy ruleset or a custom activity that you created. If you imported the PegaCustomerDataPrivacy ruleset, in the Data- class, the name of the activity is RequestCustomerData.
- Click Actions > Run.
- Enter the ID of the customer whose data you want to retrieve.
The activity returns a .json file with the requested customer data.
Previous topic Erasing customer data in Pega Platform 7.4 and earlier Next topic Retrieving customer data in Pega Platform