Discussion
Cognizant
IN
Last activity: 7 Jul 2017 11:26 EDT
Parsing json responses in to a pagelist
Hi,
I am using below API in a java step in an activity to parse a json response. It is working. But the the results are not coming into pagelist mode property.
ClipboardPage stepPage=tools.getStepPage();
try
{
stepPage.adoptJSONObject(jsonResponse);
}
catch(Exception e)
{
throw new PRRuntimeException(e);
}
sample jaon is as below,
{
"name": "Sample JSON Response",
"version": "1.0",
"date": "2015-05-16 14:38:48",
"data": {
"A": "Value A",
"B":
[
{
"RequestID": "WO-234",
"statusCode": "010",
"statusDescription": "On hold",
"messageTypeID": "Info",
"destination": "Destination 1",
"recipientName": "Recipient 1"
},
{
"RequestID": "WO-235",
"statusCode": "011",
"statusDescription": "Cancelled",
"messageTypeID": "Notif",
"destination": "Destination 2",
"recipientName": "Reciepent 2"
}
]
}
}
When I do data mapping using the schema for json it creates a property which is a pagelist. but when i run the activity it goes in error with message that the property is page list.
Looking for any inputs.
TIA