Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Mapping fields for data pages

Updated on April 6, 2022

Select the data that your application needs for processing by mapping fields from the REST request and response to the data page. By using the visual data mapper, you can easily choose the items in your request or response and drag the items to the corresponding fields in your application.

The configuration options on the Data mapping screen vary depending on how you connected your data object to a system of record. The following task describes the steps for each use case, and provides descriptions of the options in the visual data mapper that are common to all use cases.
  1. Add a sample request. If you are configuring a source and using the GET method, go to step 2.
    Configuration optionsActions
    Configuring a source with the POST method
    1. To import key value pairs from a file, in the Add sample request dialog box, click Choose File to navigate to the file, and then click Open.
      You can edit the fields as necessary.
      Each key value pair must have a colon between the key and the value and be separated by a new line, for example:

      amount: 285

      currency: usd

    2. Optional: To add key value pairs that you want to include in the request body, click Add parameter.
    3. Click Map request.
    4. Optional: To select the fields from the sample request that you want to use as data page parameters, click Add new. You can change the field name and its type.
    5. Optional: To include all the fields from the sample request as data page parameters, click Add all.
    6. Optional: To exclude all the fields in the sample request from the request body, click Clear all.
    7. Click Initialize call.
      Result: The Response tab of the Data mapping screen is displayed.
    Configuring a save option
    1. To paste a sample JSON request body or import a JSON file, click Add sample. If you chose to connect to an OpenAPI Specification on the Connection details page, go to step 3.
    2. Click Submit.
      Result: The Request tab of the Data mapping screen is displayed.
    Result: The system displays the connector parameters on the left, and the data page parameters on the right. The top-level JSON element determines the structure of the data page and is a list page if the element is an array, or a single page if the element is an object.
  2. Choose whether to use live data or data from a JSON file to create the data object. If you chose to connect to an OpenAPI Specification on the Connection details page, go to step 3.
    • To use data from your system of record, select Live response.
    • To use data from a JSON file, click Sample JSONAdd sample response. Follow the prompts to upload a file or paste in a sample JSON, and then click Submit.
  3. Map the data from the response to the fields in your data object by using the visual data mapper.
    There are some limitations to data mapping. For more information, see Data mapping limitations.
    1. Click Response.
    2. Optional: To view only the fields that are mapped or to view all fields, toggle the Mapped only option.
    3. Optional: To view details about the response, such as the return code or the raw data, click the Information icon.
    4. For each single-value item, such as a string or Boolean, that you want to use in your application, drag the item from the response column to a corresponding field in the Fields column.
      Note: Single-value items must be the same type as the field to which you are dragging the item. For example, you can only drag an item that is of type string to a field that is also a string.
    5. If a corresponding field does not exist, add a new field to the data page by clicking the Add icon.
    6. To add all the fields from the REST response to the data object using the field names, click Add all.
    7. To remove all the fields from the data object, click Clear all.
    8. Optional: To undo individual mappings in the response, hover over the green label of a connector parameter, and click the X icon.
    9. Optional: To edit the name or type of a connector parameter, click its row.
  4. Map the data from the request to fields in your data object.
    Configuration optionsActions
    Configuring a source
    1. Click Request.
    2. For each connector parameter, select the data page parameter to which you want to map, or enter a new parameter.
      Note: You can only add parameters. You cannot delete them for backwards compatibility.
    Configuring a save option
    1. To pass the parameters you specified on the Connection details page as a request from the data page, click Map parameters.
    2. In the Map to field, select the field or parameter to which you want to map your parameters.
      This feature allows you to configure constants, data page class fields, or data page parameters.
    3. Click OK.
    4. Map the data from the request to the fields in your data object by using the visual data mapper. For more details, see step 3.
  5. Click Next to advance to the Environment settings page.
What to do next: To avoid corruption of production data during development, configure connection details for different environments. For more information, see Preparing your data for production.
  • Data mapping limitations

    There are some limitations when you are mapping JSON properties to REST response and request properties. The Data Object wizard displays an error message when a mapping is invalid.

Have a question? Get answers now.

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

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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us