I have service response like this
[
{
“id”:45345,
“name”:“dfd”
},
{
“id”:45345,
“name”:“dfd”
}
]
and i want to parse this response so that i could write this data in two forms,i know that general parsing in javascrript should be like this ( in http ceonnector) S(response) and then in script task
var id=execution.getVariable(“id”);
var name=execution.getVariable(“name”);
var id=execution.getVariable(“id”);
var name=execution.getVariable(“name”);
but how can i parse more complecated response like the one i have posted here?
@StephenOTT I want to write similar logic for parsing data, but it can’t instanciate variables:
var data=S(execution.getVariable(“restResponse”));
var jsonData = JSON.parse(data);
for (var i = 0; i < jsonData.counters.length; i++) {
var counter = jsonData.counters[i];
var id = data.elements().get(counter).prop(“id”);
var nameGE = data.elements().get(counter).prop(“name”);