Unable to dot walk on rest response body

Popat420
Tera Expert

aaa

2 REPLIES 2

Harshal Aditya
Mega Sage
Mega Sage

Hi  ,

 

Could you please try something like this -

 

var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
var responseBodyJSON = JSON.parse(responseBody);
var client = responseBodyJSON.items.client;

for(var i = 0 ; i<responseBodyJSON.items.client.length;i++){
gs.info(responseBodyJSON.items.client.length[i].clientid) // If you want client ID
}

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

Harshal Aditya
Mega Sage
Mega Sage

Hi @Popat420  - Could you please try adding logs and could you share what is being returned ?