Json string to Json object in recorder showing error

Trying to create a procees to convert JSON string to JSON object to access the value but getting below error.

below is the code.

 import groovy.json.*;

@CustomScriptAction(
    input = ['jsontocsv'],
    output = 'csv'
)


def customScript()
{

def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText(jsontocsv) 
		
      //csv = object.id;
      
     //dummyvariable2 = object.ID;


//def data = new JsonSlurper().parseText(jsontocsv.toString()) 

//csv = RString.of(object.toString())

}
1 Like

@anbueceit try def object = jsonSlurper.parseText(jsontocsv as String)

1 Like

Thanks Ashapkina