- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:16 PM
Hello everyone,
I have the requirement to extract SOAP response data, which is:
For which I have built the following to get just the Json format:
Obtaining the following result and without seeing the values of the array
If any of you can tell me why that happens by passing it to a json object and how can I get only PrinterDeviceID 3, 6, 7 and 9 records?
I appreciate your help, regards.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 04:00 PM
Replace gs.log() statement with the following script.
for (var i = 0; i<obj.length; i++) {
gs.log(obj[i].SupplyChangeID + ',' + obj[i].PrinterDeviceID);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 02:51 PM
This is happening because you're parsing the data in "Execute Result" which JSON.parse is turning into an array of objects. You'll need to iterate over the array using a for loop to extract data. You can then use a nested if statement to only run whatever logic you want when the PrinterDeviceID is equal to 3,6,7,9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2020 01:16 PM
Hello Kieran, your help has helped me a lot.
I thank you and wish the best.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 04:00 PM
Replace gs.log() statement with the following script.
for (var i = 0; i<obj.length; i++) {
gs.log(obj[i].SupplyChangeID + ',' + obj[i].PrinterDeviceID);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2020 01:19 PM
Hello Kieran, your help has been very useful to me to correctly extract the information I need.
I thank you and send greetings.