how do i push values in array for a record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 11:08 PM
Hi All,
i want to puch Ip address for the ci , which has 3 records in it. I want 3 ip to be puched to the array in one go.
this is giving me 3 records or if i print it outside, it takes only one record.
var ciSys_id;
var array=[];
var IP=new GlideRecord("cmdb_ci_ip_address");
//IP.addEncodedQuery("netmask!=64^ORnetmask=NULL^last_discoveredRELATIVEGT@dayofweek@ago@3^nic.cmdb_ci!=NULL");
IP.addQuery("nic.cmdb_ci", "8e01285f1bc4d990635f9714b24bcbac");
//IP.setLimit(5);
//IP.groupBy("nic.cmdb_ci");
IP.query();
while(IP.next())
{
ciSys_id=IP.nic.cmdb_ci;
array.push(IP.ip_address);
gs.print("sys_id"+ciSys_id+array);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2022 04:18 AM
Hi,
There is a slight that is required:
gr.u_associated_ip_addresses= obj[id];
This will work for you!
If my answer helped you out then please mark my answer as correct/helpful, so that other community members facing similar issues might get help.
Thanks and regards,
Kartik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2022 09:55 PM
Hi,
This is also not working, i am getting org.mozilla.javascript.NativeArray@ff865 value.