Skip to main content

Integrating an external data source

3 Tasks

25 mins

Visible to: All users Applies to: Pega Customer Service '25
Advanced
English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

A REST service has been created to access contact data for a customer. Your task is to access that data to replace the sample data used by the Contact entity.

The following table provides the credentials that you need to complete the challenge:

Role User name Password
Application Administrator CSSystemAdmin password123!

Your assignment consists of the following tasks:

Task 1: Use the Data and integration designer to configure the connector to external data and map the response data

In the Data Portal, run the Data and integration designer to connect to the external data source and map the response data to the Contact entity.

Task 2: View the external contact data

Call the REST service and process the response.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Use the Data and Integration Designer to configure the connector to external data and map the response data

  1. In the Pega instance for the challenge, click Launch Pega Infinity™ , and then log in as an Administrator by entering the following credentials:
    1. In the User name field, enter CSSystemAdmin.
    2. In the Password field, enter password123!.
  2. In the header of Dev Studio, click Launch Portal > Data Portal.
  3. In Data Portal, click Create > Data and integration designer.
  4. In the Create Data and integration designer dialog box, configure your entity:
    1. In the Choose an option section, select Existing entity,
    2. In the Select entity section, click Contact.
    3. In the Select an action section, select Integrate with Data sources.
    4. Click Submit.
      Create data and integration designer dialog
  5. Configure the source details:
    1. In the Select profile section, click Go, and then select the Contact Data Page.
    2. In the Profile list, select CONTACT_DETAIL, and then click Submit.
    3. In the Source details section, in the Select Source Connector section, click New.
    4. In the Source type list, select REST, and then select Replace.
    5. Click Continue.
  6. Configure the connection details:
    1. In the System Name field, enter ExternalCon.
    2. In the Resource Name field, enter Con1.
    3. In the Endpoint URL field, enter http://localhost:8080/prweb/PRRestService/test/01-01-01/getContactData/ContactId
    4. In the Resource path parameters, select the ContactId parameter.
    5. In the Authentication section, click Add authentication to configure the authentication service.
    6. Select Define New.
    7. In the User name field, enter serviceuser.
    8. Click Set password, enter password123!, and then click Submit.
    9. Click Continue.
  7. Configure the request response:
    1. Click Add a REST response.
    2. In the ContactId parameter, enter ContactId, and then click Run.
      Note: The dialog box displays the data for the contact named Pat Smith. This is the one contact in our external data source.
    3. Click Submit, and then click Continue.
  1. In the Visual mapper, click the Request tab, and then to the right of the ContactId parameter, select Key.
  2. In the Visual mapper, map the base properties.
    1. Click the Response tab, and map the Source fields to the Target fields for the following properties:

      Source

      Target

      FirstName

      .FirstName

      LastName

      .LastName

      ContactId

      .ContactId

    2. Click Continue.
    3. On the Review and save page, click Finish. The Designer displays the Configure mapping page. If you get a page error, refresh the browser page, and then click Go to display the Configure mapping page.
  1. Map the Page properties for primary address.
    1. In the Configure the mapping section, click Response mapping, The Edit Data Transform page shows the three fields entered earlier: .FirstName, .LastName, .ContactID
      Note: When mapping properties on the Edit Data Transform page, if you delete an entry, click Save to save your changes. You will see an error message. Refresh the page to continue to add entries.
    2. Click Add element, then select the Action named Append and map to. In the Clipboard field, enter .AddressList; in the Relation field, select An array of objects.
    3. Add subentries for the following .AddressList properties. Click Add element to add each field.

      Clipboard

      Source JSON

      .Line1

      AddressLine1

      .Line2

      .AddressLine2

      .City

      City

      .RegionID

      State

      .PostalCodeID

      Zip

    4. Collapse the .AddressList entries.
  1. Map the Page list property for phone number.
    1. Click Add element, then select the Action named Append and map to. In the Clipboard field, enter .PhoneList; in the Relation field, select An array of objects.
    2. Under .PhoneList, add a subentry with Clipboard value .PhoneNumber and Source JSON value MobilePhone.
    3. Collapse the .PhoneList entry.
  2. Map the Page list property for email address.
    1. Click Add element, then select the Action named Append and map to. In the Clipboard field, enter .EmailList; in the Relation field, select An array of objects.
    2. Under .EmailList, add a subentry with Clipboard value .Email and Source JSON value Email.
    3. Click Save.to close the Edit Data Transform page.
    4. In the Configure the mapping section, click Submit.
  3. At the top of the Case, click the Test Entity Stage.
  4. In the Run entity section, in the ContactID field, enter ContactId, and then click Run Data Page.
    Note: The page displays the properties for the Pat Smith contact.
  1. Click Submit. The Designer displays the Case Summary.
  2. Click Resolve.
    Note: The Data Integration Designer completes integration of the data source and resolves the Case.
    Case resolved, all stages complete

2 View the external contact data

You can now view the data from the external source in your Contacts.

In the navigation pane of the Data Portal, click Contacts, and then select any contact in the list.
The contact details now show the data from the external source

Note: There is one record in the external source for a contact named Pat Smith, which means any Contact that you select now shows the contact details for Pat Smith.

3 Optional: Edit the Contacts view to show the external data in the summary

When you view a contact, the summary can show basic information such as the contact name, address, email address, and phone number. As we are using an external data source, the summary data is not populated automatically. You can make changes to this view.

  1. In the header of Dev Studio, click Dev Studio > App Studio to switch the application.
  2. In the left navigation of App Studio, click Data, then scroll down and click Contact.
  3. In the Contact data object, click the UX tab.
    Note: The UX tab shows the layout of fields for the views that display a Contact in the Data Portal.
  1. In the Heading field, select Last name.
  2. In the Subheading field, select Contact ID.
  3. In the Highlighted fields section, click Add and then select the following fields: First name, Last Name, AddressLine1, AddressLine2, City, State, Zip.
  4. Click Add to add the fields to the Full View.
    Full Page View layout for Contacts
  5. Click Save.
  6. In the header of App Studio, click App Studio > Dev Studio to switch applications.
  7. In the header of Dev Studio, click Launch portal > Data Portal.
  8. In the left navigation of the Data Portal, click Contacts.
  9. In the list of contacts, click any contact to display the full view.
    Contact summary in Data Portal

The Summary shows the external data you configured for the view: Last name and Contact ID in the heading; First and Last name and address in the highlighted fields.



Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice