Looping through all the fields from rest response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2024 02:04 PM
I have a rest response of a few hundred records. I need to iterate through all and set the fields. Is there a way to loop through the rest api response and get the field names and set them? my table field values match the rest response field names.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2024 12:25 AM
Hi,
Please find the script to loop through all the keys and get the values. you can update it based on your requirement
var data = {"field1":"value1", "field2":"value2"}
for (var name in data) {
gs.info(data[name])
}
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2024 05:28 AM
Thank you, I tried it but getting only the first value

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2024 07:13 AM
Palani