Creating a data type using a JSON file

Reduce application development time by using a JSON file to create a data type when a live endpoint is not available.

By using a JSON file, you can create the response schema without connecting to the endpoint. The JSON file is only used by the Data Type wizard to create the schema; it is not saved.
  1. In the navigation panel of App Studio, click Data.
  2. Click Data types and integrations.
  3. Click New.
  4. In the Create new data type field, enter the name of the data type.
  5. In the Define source data field, click Now.
  6. In the System field, select a system other than Pega to connect to, or click Create new.
  7. In the Method field, select GET or POST.
  8. In the Endpoint URL field, select one of the following options:
    • If you do not know the endpoint URL, enter a sample URL, for example, http://myendpoint.com.
    • Enter the actual URL of your endpoint.
  9. Click Initialize call.
    Result: If you entered a sample URL, an error is displayed. Ignore this error.
  10. Optional: If you are using the GET method, perform the following steps:
    1. Click Sample JSON.
    2. Perform one of the following actions:
      • To upload a JSON file, click Choose File and then follow the prompts to upload the file.
      • In the Response Text field, paste in the response data that you have copied from, for example, a web page or file.
    3. Select the fields that you want to include in the data type and map them to your data view by using the following options:
      • To add the fields to a data type, click Add new. You can change the field name and its type.
      • To add all of the fields from the REST response to the data type using the same field names, click Add all. To change the name and the data type, click the name. To remove a field mapping, click on the name and click the delete icon.
      • To remove all fields from the data type, click Clear all.
  11. Optional: If you are using the POST method, perform the following steps:
    1. Click Add sample request.
    2. Click Choose file.
    3. Go to the file and click Open.
    4. Click Map request.
    5. To add a field to the data view, click Add new.
      1. In the Map to field, enter the name of the field.
      2. Select the type of data that the field contains.
    6. Click Initialize call.
    7. To map data, follow the instructions in step 10.
  12. Click Next.
  13. Click Submit.