How to parse Nested JSON response

Muktha R2
Kilo Contributor

Hi All,

Please help me with JSON parsing.

Below is the response body:

find_real_file.png

I am Parsing the response through Flow designer script, and i am able to parse and fetch the "name" value  in the above response. But I am unable to parse the underlined text (href).  

Below is the script.

var result = JSON.parse(inputs.response);

gs.info("Name is:"+ result[0].name);

 

Please help me with this  .

 

3 REPLIES 3

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

Community Alums
Not applicable

As @Pavlo Rudenko  already mentioned - its a good example. Just use the following notation regarding the JSON -> not "new JSONParser" (or whatever similar) but just JSON.stringify(<object here>) or JSON.parse(<string here>). The old way might work but better be on the safe side.

 

Cheers,

Joro

P-Rudenko-SN
ServiceNow Employee
ServiceNow Employee

@Muktha R did you manage to parse your JSON responce?