You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Groovy jsonSlurper Failing

Summary:

I am trying to parse a JSON response, and I have code that works in a Groovy web console, but the exact same code does not work in a Planning Groovy business rule:


I have tried casting the object to Map, and I get

Content (please ensure you mask any confidential information):


Version (include the version you are using, if applicable):



Code Snippet (add any code snippets that support your topic, if applicable):

import groovy.json.JsonSlurper

def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText(
"""{
"count": 2,
"value": [
{
"fiscal_year": "2023-24",
"account_number": "01-2100",
},
{
"fiscal_year": "2023-24",
"account_number": "01-1101",

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!