Forum Discussion
rakesh133
8 years agoOccasional Contributor
nmrao The Json response array is something like below.
[
{
"AgreementType": "XXXX",
"Code": "XXXX",
"ShortName": "XXXX",
"Name": "XXXX",
"Description": "XXXX",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-05-04T13:34:01Z"
},
{
"AgreementType": "XXXX",
"Code": "XXXX",
"ShortName": "XXXX",
"Name": "XXXX",
"Description": "XXXX",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-05-04T13:34:01Z"
},
{
"AgreementType": "XXXX",
"Code": "XXXX",
"ShortName": "XXXX",
"Name": "XXXX",
"Description": "XXXX",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-05-04T13:34:01Z"
},
{
"AgreementType": "XXXX",
"Code": "XXXX",
"ShortName": "XXXX",
"Name": "XXXX",
"Description": "XXXX",
"DocumentManagementStoreUrl": null,
"IsActive": true,
"EffectiveDate": "2013-12-10T00:00:00",
"TerminationDate": null,
"WasCreatedInError": false,
"DataTimeStamp": "2018-05-04T13:34:01Z"
}nmrao
8 years agoCommunity Hero
Should be simple:
def json = new groovy.json.JsonSlurper().parseText(jsonString)
log.info json.Code
Demo
https://ideone.com/Obt8TV
def json = new groovy.json.JsonSlurper().parseText(jsonString)
log.info json.Code
Demo
https://ideone.com/Obt8TV