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


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 = """{



   "user1": "[email protected]",

   "user2": "[email protected]""





   "user1": "[email protected]",

   "user2": "[email protected]",

"user3": "[email protected]"





   "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.


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