Iterate over a JSON API Response using Groovy script with parsing the response

I have a JSON Response which I need to loop over in order to perform some actions using Groovy in Oracle CRM. It looks something like this:

{
    "items": [
        {
            "JeBatchId": 61003,
            "AccountedPeriodType": "MONTH9042232881"
        },
        {
            "JeBatchId": 60004,
            "AccountedPeriodType": "MONTH9042232882"
        },
        {
            "JeBatchId": 60005,
            "AccountedPeriodType": "MONTH9042232883"
        },
        {
            "JeBatchId": 60006,
            "AccountedPeriodType": "MONTH9042232884"
        },
        {
            "JeBatchId": 60007,
            "AccountedPeriodType": "MONTH9042232885"
        },
        {
            "JeBatchId": 60008,
            "AccountedPeriodType": "MONTH9042232886"
        },
        {
            "JeBatchId": 60009,
            "AccountedPeriodType": "MONTH9042232887"
        }
    ]
}

I tried parsing it using groovy.json.JsonSlurper().parseText(json) but Oracle CRM does not seems to support import functionality. Is it possible to do this without importing an library in CRM?

Upvotes: 0

Views: 51

Answers (0)

Related Questions