How to delete all records which i have loaded through import sets to hardware table.

Chaitanya Redd1
Tera Guru

Hello Team,

I/'m trying to delete all the records which I have loaded using import set. i'm trying to delete manually but some how few records are still showing up when I click on that records it's showing record not found. 

Can anyone help me to delete all the records using any script.

 

Thanks,

JRY

1 ACCEPTED SOLUTION

DirkRedeker
Mega Sage
Hi It looks as if you put in a class value in your transform script that is invalid. Can you share a screenshot of ghd ghost records list including the "class" column? Can you change the value of the class field manually and delete the records afterwards? Let me know if that answered your question and mark my answer as correct and helpful BR Dirk

View solution in original post

17 REPLIES 17

find_real_file.png

find_real_file.png

You can see below screenshot where State is showing Installed but it has to be in In Use when i have tried to change on list view it's not getting change because this records already been delted.

 

find_real_file.png

When clicking one of the record it's showing below error.

find_real_file.png

and i need one more i'm trying to computer set the class in the import set tables,so all the assets are just created in the cmdb_ci table instead of the sys_name_class. for that i have written below script 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
 target.sys_class_name = "cmdb_ci_computer";
})(source, map, log, target);
 
 
 
it's setting in correct ci but when i'm looking to records it's showing empty fields on cmdb_ci_computer table as well as on alm_hardware table but when i checking transform records which loaded in that i can find the records are there.
 
Can you please help me going on multiple issues.
 
Thanks,
JRY

 

Hi,

Is the screenshot from import set table?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Import set table is empty because i have  deleted data from there as well.

 

find_real_file.png

Hi,

that is what was required right? deleting import set table i.e. cleaning it

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

No, i think you got me wrong in import table the records are empty but i can see the records in alm_hardware table which I tried delet it but that records not delteing and when I tried to open one of the record it show's record not found.

and

second issue - 

when i'm trying to load records for example i'm trying to load of computer data to hardware records are creating but here one issue it's creating in right class(cmdb_ci_computer) it's creating in (cmdb_ci) i need here if i'm trying to load data then data has to be created in cmdb_ci_computer or if i load server data then data class has to be in server(cmdb_ci_server).

i have tried using belwo Onbegore script records are creating in right class but few of the fields like Model, Model category , device type this all fields are empty in alm_hardware table as well as cmdb_ci_computer table as well.

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
 
 target.sys_class_name = "cmdb_ci_computer";
})(source, map, log, target);