Parsing and access of JSON data in robotic automation
Once you have created and validated the JSON schema, you can parse and access the data within your automation. You do this by using the ParseFile method of the JSONParser component, and then extract the base proxy. Parsing the JSON file converts it into a .NET object, while the base proxy enables you to access its elements through the Select action window. For detailed steps on creating a base proxy, see Creating a proxy from a JSON file on the Pega Documentation site.
Creating proxy for selected items
To access elements within a nested data structure in a JSON file, you must create an additional proxy. For example, a telecommunications provider prepares incident reports for specific customers. Each customer has a nested structure of assigned claims, as shown in the following figure:
To access the nested structure, you need to create a proxy for the customers based on the customer ID. The proxy enables you to loop through the embedded data, as shown in the following figure:
For more information on creating a proxy for embedded arrays, see Creating a proxy from selected items on the Pega Documentation site.
Check your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?