Skip to main content

Adding case creation fields in DX API v2

Suggest edit Updated on January 14, 2022

Add starting fields to your cases by creating a data transform that DX API v2 supports. For example, you can specify that new loan cases include fields that capture account details.

Note: This article applies to Pega Platform™ version 8.6.1 and subsequent 8.6 patch releases.

You can add the following elements to new cases:

  • Scalar properties
  • Embedded pages (including properties)
  • Page lists (including properties)
  • Page group (including properties) – not recommended
  • Attachments
Note: The data transform supports only one entry for page lists and page groups.

For example, a page list includes the following entries:

  • .Transactions(1). Amount
  • .Transactions(2). Amount
The data transform disregards the indexes and processes only the first entry: .Transactions(1). Amount.

Endpoint:POST /cases

In this scenario, you configure a loan request that captures the user's account details, transaction value, and includes an attachment.

You create a data transform and configure it with the appropriate properties. When the data transform runs, it generates a page of your chosen class that includes the properties (without the values).

  1. Create a data transform in the class that holds the properties that you need and name the transform AllowedStartingFields.
  2. On the Definition tab of the data transform, clear the Call superclass data transform check box.
  3. Add scalar properties:
    1. In the first row, in the Target field enter .pyDescription and in the Source field, enter ""
    2. In the second row, in the Target field enter .pyLabel and in the Source field, enter "".

    See the following figure for reference:

    Scalar properties
  4. Add page properties:
    1. Add a row with the Update Page action, and then, in the Target field, enter .AccountDetails.
    2. Add a child row, and then set .ID to "".
    3. Add a second child row, and then set .Startdate to "".

    See the following figure for reference:

    Page properties
  5. Add page list properties:
    1. Add a row with the Append and Map to action, and then, in the Target field, enter .Transactions.
    2. Add a child row, and then set .Amount to "".
    3. Add a second child row, and then set .ToAccount to "".

    See the following figure for reference:

    Page list properties
  6. (Not recommended) Add page group properties:
    1. Add a row with the Update Page action, and then, in the Target field, enter .LocationDetails(HOME).

      (HOME) is a sample subscript for the LocationDetails page group.

    2. Add a child row, and then set .Latitude to "".
    3. Add a second child row, and then set .Longitude to "".

    See the following figure for reference:

    Page group properties
  7. Add attachment properties:
    1. Add a row with the Update Page action, and then, in the Target field, enter .Itinerary.
    2. Remove the default child row. 

    See the following figure for reference:

    Attachment property

The following sample request body uses content from scalar properties ("content"), page properties ("pageInstructions"), and attachment properties ("attachments"):

Sample request JSON

The ID in the "attachments" array is the output of the /attachments/upload endpoint.

Did you find this content helpful? YesNo

50% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us