Asset imports and CI updates

eschoon
Kilo Contributor

I've built a basic transform map to import assets into the hardware assets and it works ok.   This also creates a CI for the asset (fantastic) but i'd like to autofill some of the CI data from the excel file data import.   I tried mapping to Computer CI in the map but that's not working as i don't believe you can make to multiple destination tables in 1 transform map.   I created a 2nd map for CI and ran it but it just inserts a new CI record not linked to the Asset (so i end up with duplicates).

What is the best method to use a csv data load for assets but then populate more data for the corresponding CI created with the asset?

16 REPLIES 16

akash_mehta
ServiceNow Employee
ServiceNow Employee

Eric:   So in one of the screen shots I see Serial Number as the source - but the target is the name field?   Are you setting the serial number to the name value for some reason?   If not, change the target to be Serial Number.



Also, can you attach a screen shot of the 2 transform maps - with the mapping sections.   I don't need you to go into each mapping, just the transform map with the related list of mappings below (source field, target field, coalesce).



Also, if you have any scripts running as before or after - a screen shot of that would be helpful as well.


Yes, on the Asset Import it creates the CI but doesn't fill in the name (by design of course). I want the serial number to be copied from the Asset to the CI name field so that we can easily search for the CI before it is deployed. Once deployed the midserver would update the name through the nightly scans.



Asset Import transform map and Update CI map attached.



The only script I have running is an OnBefore script on the CI update map


if(action == 'insert'){


ignore = true;


}


akash_mehta
ServiceNow Employee
ServiceNow Employee

Eric:   Thank you for attaching.



So, the first transform map (Asset) is setting the serial number field - so this should be synchronized to the CI record.



In the second mapping - do the following:


u_serial_number -> serial_number -> coalesce = true


u_serial_number -> name -> coalesce = false



If you want to update the Name value on the CI you will need to map the serial number to the name and then the serial number to the serial number field and coalesce on the serial number field to find the match.



that should do it...


No luck. It ignored the 10 CI updates. This error was generated in the log file = "*** Script: Duplicate asset generation prevented for CI"



For some reason it wants to keep inserting a new CI instead of recognizing the CI created by the Asset import. Very odd.


akash_mehta
ServiceNow Employee
ServiceNow Employee

can you attach the mapping screen shot again after the change?



-Akash