Solved
Forum Discussion
ChrisAdams
2 years agoChampion Level 3
Hi,
Here's some example Groovy script....
import groovy.json.JsonSlurper;
def slurper = new groovy.json.JsonSlurper();
def result = slurper.parseText('{"list": [{"status": "ACTIVE", "Number": 123, "Version": "1.12"}]}');
// Can we get the list?
log.info(result.list);
// Let's get the idividual values. Bear in mind, list is an array
// this won't work as we're assuming list is an object, not an array....
//log.info(request.list.status);
// Access the list as an array. Note the props are case sensitive...
log.info(result.list[0].status);
log.info(result.list[0].Number);
log.info(result.list[0].Version);
// create a var....
def status = result.list[0].status;
return status;
Related Content
- 3 years agoprekar
- 9 years agoDenisMedvedev