Register today for Oracle CloudWorld. October 17th - 20th, Las Vegas

Register now

Hillel Cooperman, Senior VP of User Experience Design, has a message for you on Oracle CloudWorld

Watch now
Retrieving size of JSON key using groovy script in EPBCS — Cloud Customer Connect
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

Retrieving size of JSON key using groovy script in EPBCS

Received Response
11
Views
3
Comments

Summary:

Need to retrieve size of keys in JSON array using EPBCS groovy script.

Content (required):

Hello guys,

I have the following JSON array:

def json_str = """{

  "1010CC":

   {

   "user1": "[email protected]",

   "user2": "[email protected]""

   }

  ,

  "1020CC": 

  {

   "user1": "[email protected]",

   "user2": "[email protected]",

"user3": "[email protected]"

  }

  ,

  "2010CC": 

  {

   "user1": "[email protected]",

   "user2": "[email protected]"

  } """

I need to get the size of the keys like for 1010CC-> size = 2, for 1020CC->size=3,etc.

I have tried the below.

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


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

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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