My Json response from servicenow is as follows:
*** Script:
[
{
"errno":"0",
"num_keys":"0",
"ipmdns_hsm_enabled":"0",
"ipmdns_protocol":"https",
"ipmdns_type":"named",
"dns_force_hybrid":"0",
"gss_keytab_id":"0",
"use_update_policy":"0",
"dnszone_synching":"0",
"dns_state":"Y",
"vdns_parent_id":"0",
"dnszone_allow_update":"admin;",
"dnszone_allow_query":"",
"dnszone_allow_transfer":"",
"dnszone_forwarders":"",
"dnszone_forward":"default",
"dnszone_notify":"",
"dnszone_also_notify":"",
"dnszone_name_utf":"amec.com",
"dnszone_id":"31704",
"row_enabled":"1",
"dns_type":"ipm",
"dns_cloud":"0",
"dnszone_ad_integrated":"0",
"dnszone_sort_zone":"amec.iras-tp.com",
"dns_id":"6",
"dns_name":"dnscom",
"dnszone_name":"amec.iras-tp.com",
"dnszone_rev_sort_zone":"com.iras-tp.amec",
"dnszone_is_rpz":"0",
"dnszone_type":"master",
"dnszone_masters":"",
"dnszone_xfer_done":"Y",
"dnszone_is_reverse":"0",
"delayed_delete_time":"0",
"delayed_create_time":"0",
"dnszone_order":"0",
"dnszone_site_name":"Gen",
"dnszone_site_id":"3",
"dnszone_class_name":"",
"dnsview_name":"#",
"dnsview_id":"0",
"dnsview_class_name":"",
"dns_class_name":"",
"dns_comment":"Niewegein NL-213 ",
"dns_version":"BIND 9.11.8",
"vdns_parent_name":"#",
"ds":"",
"ip_addr":"fghjj",
"multistatus":"",
"dnszone_class_parameters":"ipam_replication=1&dnsptr=1",
"dnszone_class_parameters_properties":"ipam_replication=inherited,restrict&dnsptr=inherited,restrict",
"dnszone_class_parameters_inheritance_source":"ipam_replication=real_dns,6&dnsptr=real_dns,6",
"dnsview_class_parameters":"",
"dnsview_class_parameters_properties":"",
"dns_class_parameters":"ipam_replication=1&dnsptr=1",
"dns_class_parameters_properties":"ipam_replication=set,propagate&dnsptr=set,propagate"
},
{
"errno":"0",
"num_keys":"0",
"ipmdns_hsm_enabled":"0",
"ipmdns_protocol":"https",
"ipmdns_type":"named",
"dns_force_hybrid":"0",
"gss_keytab_id":"0",
"use_update_policy":"0",
"dnszone_synching":"0",
"dns_state":"Y",
"vdns_parent_id":"0",
"dnszone_allow_update":"admin;",
"dnszone_allow_query":"",
"dnszone_allow_transfer":"",
"dnszone_forwarders":"",
"dnszone_forward":"default",
"dnszone_notify":"",
"dnszone_also_notify":"",
"dnszone_name_utf":"emea.iras-tp.com",
"dnszone_id":"31700",
"row_enabled":"1",
"dns_type":"ipm",
"dns_cloud":"0",
"dnszone_ad_integrated":"0",
"dnszone_sort_zone":"emea.iras-tp.com",
"dns_id":"6",
"dns_name":"dnscom",
"dnszone_name":"emea.iras-tp.com",
"dnszone_rev_sort_zone":"com.iras-tp.emea",
"dnszone_is_rpz":"0",
"dnszone_type":"master",
"dnszone_masters":"",
"dnszone_xfer_done":"Y",
"dnszone_is_reverse":"0",
"delayed_delete_time":"0",
"delayed_create_time":"0",
"dnszone_order":"0",
"dnszone_site_name":"Gen",
"dnszone_site_id":"3",
"dnszone_class_name":"",
"dnsview_name":"#",
"dnsview_id":"0",
"dnsview_class_name":"",
"dns_class_name":"",
"dns_comment":"Niewegein NL-213 ",
"dns_version":"BIND 9.11.8",
"vdns_parent_name":"#",
"ds":"",
"ip_addr":"8jhg1",
"multistatus":"",
"dnszone_class_parameters":"ipam_replication=1&dnsptr=1",
"dnszone_class_parameters_properties":"ipam_replication=inherited,restrict&dnsptr=inherited,restrict",
"dnszone_class_parameters_inheritance_source":"ipam_replication=real_dns,6&dnsptr=real_dns,6",
"dnsview_class_parameters":"",
"dnsview_class_parameters_properties":"",
"dns_class_parameters":"ipam_replication=1&dnsptr=1",
"dns_class_parameters_properties":"ipam_replication=set,propagate&dnsptr=set,propagate"
},
{
"errno":"0",
"num_keys":"0",
"ipmdns_hsm_enabled":"0",
"ipmdns_protocol":"https",
"ipmdns_type":"named",
"dns_force_hybrid":"0",
"gss_keytab_id":"0",
"use_update_policy":"0",
"dnszone_synching":"0",
"dns_state":"Y",
"vdns_parent_id":"0",
"dnszone_allow_update":"admin;",
"dnszone_allow_query":"",
"dnszone_allow_transfer":"",
"dnszone_forwarders":"",
"dnszone_forward":"default",
"dnszone_notify":"",
"dnszone_also_notify":"",
"dnszone_name_utf":"apac.iras-tp.com",
"dnszone_id":"31708",
"row_enabled":"1",
"dns_type":"ipm",
"dns_cloud":"0",
"dnszone_ad_integrated":"0",
"dnszone_sort_zone":"apac.iras-tp.com",
"dns_id":"6",
"dns_name":"dnscom",
"dnszone_name":"apac.iras-tp.com",
"dnszone_rev_sort_zone":"com.iras-tp.apac",
"dnszone_is_rpz":"0",
"dnszone_type":"master",
"dnszone_masters":"",
"dnszone_xfer_done":"Y",
"dnszone_is_reverse":"0",
"delayed_delete_time":"0",
"delayed_create_time":"0",
"dnszone_order":"0",
"dnszone_site_name":"Gen",
"dnszone_site_id":"3",
"dnszone_class_name":"",
"dnsview_name":"#",
"dnsview_id":"0",
"dnsview_class_name":"",
"dns_class_name":"",
"dns_comment":"Niewegein NL-213 ",
"dns_version":"BIND 9.11.8",
"vdns_parent_name":"#",
"ds":"",
"ip_addr":"56kjhffc1",
"multistatus":"",
"dnszone_class_parameters":"ipam_replication=1&dnsptr=1",
"dnszone_class_parameters_properties":"ipam_replication=inherited,restrict&dnsptr=inherited,restrict",
"dnszone_class_parameters_inheritance_source":"ipam_replication=real_dns,6&dnsptr=real_dns,6",
"dnsview_class_parameters":"",
"dnsview_class_parameters_properties":"",
"dns_class_parameters":"ipam_replication=1&dnsptr=1",
"dns_class_parameters_properties":"ipam_replication=set,propagate&dnsptr=set,propagate"
},
{
"errno":"0",
"num_keys":"0",
"ipmdns_hsm_enabled":"0",
"ipmdns_protocol":"https",
"ipmdns_type":"named",
"dns_force_hybrid":"0",
"gss_keytab_id":"0",
"use_update_policy":"0",
"dnszone_synching":"0",
"dns_state":"Y",
"vdns_parent_id":"0",
"dnszone_allow_update":"admin;",
"dnszone_allow_query":"",
"dnszone_allow_transfer":"",
"dnszone_forwarders":"",
"dnszone_forward":"default",
"dnszone_notify":"",
"dnszone_also_notify":"",
"dnszone_name_utf":"uat.iras-tp.com",
"dnszone_id":"33045",
"row_enabled":"1",
"dns_type":"ipm",
"dns_cloud":"0",
"dnszone_ad_integrated":"0",
"dnszone_sort_zone":"uat.iras-tp.com",
"dns_id":"6",
"dns_name":"dnscom",
"dnszone_name":"uat.iras-tp.com",
"dnszone_rev_sort_zone":"com.iras-tp.uat",
"dnszone_is_rpz":"0",
"dnszone_type":"master",
"dnszone_masters":"",
"dnszone_xfer_done":"Y",
"dnszone_is_reverse":"0",
"delayed_delete_time":"0",
"delayed_create_time":"0",
"dnszone_order":"0",
"dnszone_site_name":"Gen",
"dnszone_site_id":"3",
"dnszone_class_name":"",
"dnsview_name":"#",
"dnsview_id":"0",
"dnsview_class_name":"",
"dns_class_name":"",
"dns_comment":"Niewegein NL-213 ",
"dns_version":"BIND 9.11.8",
"vdns_parent_name":"#",
"ds":"",
"ip_addr":"fghlkj",
"multistatus":"",
"dnszone_class_parameters":"ipam_replication=1&dnsptr=1",
"dnszone_class_parameters_properties":"ipam_replication=inherited,restrict&dnsptr=inherited,restrict",
"dnszone_class_parameters_inheritance_source":"ipam_replication=real_dns,6&dnsptr=real_dns,6",
"dnsview_class_parameters":"",
"dnsview_class_parameters_properties":"",
"dns_class_parameters":"ipam_replication=1&dnsptr=1",
"dns_class_parameters_properties":"ipam_replication=set,propagate&dnsptr=set,propagate"
}
]
which contains 4 set of values. But when I choose response.length; output is 6700, where it should return "4". What is the javascript code to do it i.e to get number of sets in array and treat each set as a separate array?