Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 09:13 PM
Hello,
You can add another set of values by pushing another object into that "records" array, i.e.
gs.print("code: " + httpResponseStatus);
gs.print("body: " + JSON.parse(response.getBody()));
var b = JSON.parse(response.getBody())
var data = b.records;
//Just an example, you could also push the details directly to b.records variable
//and can then convert b variable back to JSON string if that's what you wanted to do
data.push({"name" : "test", "data" : "test"});
for (var i in data)
{
var id = data[i].name;
var name = data[i].data;
gs.print("body 1: " + id);
gs.print("body 1: " + name);
}
That would add another set of values / JSON object in the records array.
Hope this helps!
Cheers,
Manish