Jump to content

Can the manual import csv facility have the ability to identify existing assets and update these rather than create duplicate?


Adrian Simpkins

Recommended Posts

Hi All,

We have a requirement where we want our engineers to update certain data fields in issued assets. We have our daily interface into our SCCM pulling in the asset data. However our engineers work a large number of requests daily where they then have to update the asset data. Rather than having to manually go into each asset our idea would be to load this data to a spreadsheet instead, and upload this on probably a daily basis. Currently the csv upload facility just creates assets, and there is no update to existing asset function (this is available of course within the actual SCCM interface config).

Would it be possible to enhance the csv functionality to allow for update and creation of assets please?

Many thanks

Link to comment
Share on other sites

Adrian - note that the Database Asset Import (v3) does allow Update and/or Create:
OperationType - The type of operation that should be performed on discovered assets - can be Create, Update or Both. Defaults to Both if no value is provided

I haven't moved to the new version yet but I think as long as you specify the Asset Type (which is the problem for me as the system creating the incoming csv file doesn't have that info) then it will update an existing record rather than create a duplicate.

  • Like 1
Link to comment
Share on other sites

Ah thanks Frank - I did not notice the new version allowing the option to update and create - thank you for highlighting it (sometimes hard to take on board all changes when its just little old me ha)

I will take another look 

Many thanks !

Link to comment
Share on other sites

  • 1 month later...

New to the Asset import tool. However I am struggling to see, from the templates, how data is imported from a csv file.  Do you have any examples that I could look at.  I don't understand the difference (and/or what fields I need) for AssetGenericFieldMapping and AssetTypeFieldMapping - I am trying to rename the Name of the asset using the two attached files.

 

ReloadName.csv conf_ReloadName_csv.json

Link to comment
Share on other sites

Have now set APIKey and InstanceID correctly but am still getting the following message:

PS C:\asset_import> ./goDBAssetImport -dryrun=true -file=.\conf_ReloadName_csv.json
[ERROR] Error Decoding Configuration File: read C:\asset_import/: The handle is invalid.
[ERROR] Unable to retrieve endpoint information for the supplied InstanceID:
PS C:\asset_import>

Link to comment
Share on other sites

It appears to run now (Maybe had to wait for permissions to filter) - however fails to update any records.   Have you got any examples of a simple json file and csv file?  I don't think I have the AssetGenericFieldMapping and/or AssetTypeFieldMapping set quite right.  Not sure I understand the difference and how they work.

Current binary is the latest version: 3.3.0
---- XMLMC Database Asset Import Utility v3.3.0 ----
[DEBUG] Flag - Config File conf_ReloadName_csv.json
[DEBUG] Flag - Dry Run false
[DEBUG] Flag - Concurrent 1
Caching Application Records from Hornbill...
Running CSV query for BASE assets. Please wait...
1 of 1 returned assets successfully retrieved ready for processing.
Caching BASE Asset Records from Hornbill...
 4471 / 4471 [=============================================================================================] 100.00% 0s
Hornbill BASE Asset Records Cached

Processing 1 of BASE Type Assets...
 1 / 1 [===================================================================================================] 100.00% 0s
BASE Asset Type Processing Complete!

-=-=-= Summary =-=-=-
Created: 0
Create Skipped: 0
Create Failed: 0
Updated: 0
Update Skipped: 0
Update Failed: 0
Update Extended Record Skipped: 0
Update Extended Record Failed: 0
Assets Software Inventory Skipped: 0
Software Records Created: 0
Software Records Create Failed: 0
Software Records Removed: 0
Software Records Removal Failed: 0
Asset Supplier Associations Success: 0
Asset Supplier Associations Failed: 0
Asset Supplier Associations Skipped: 0
Asset Supplier Contract Associations Success: 0
Asset Supplier Contract Associations Failed: 0
Asset Supplier Contract Associations Skipped: 0
Time Taken: 3s
---- XMLMC Database Asset Import Complete ----

Link to comment
Share on other sites

28 minutes ago, Carl Reeder said:

I don't think I have the AssetGenericFieldMapping and/or AssetTypeFieldMapping set quite right.

While this is the case, please ensure you keep the dryrun flag set to true.

28 minutes ago, Carl Reeder said:

Not sure I understand the difference and how they work.

AssetGenericFieldMapping are the values that apply to all assets, these are stored in the h_cmdb_assets table and are discussed here.
AssetTypeFieldMapping are specific to the asset type, these are stored in the various h_cmdb_assets_basic_[type] tables and are discussed here.
Sample JSON configurations are also given on the wiki page

 

35 minutes ago, Carl Reeder said:

Running CSV query for BASE assets. Please wait...

Have you created an Asset Type of BASE?
This is not a default Asset Type, so if not the import will not work.

Link to comment
Share on other sites

Some success thank you have managed to update one field in a record.  Where can I find the table structure to see how the tables relate to each other?  So we have Asset Tag under financial information - but how can I check that this relates to h_asset_tag in the tables and not a reused field?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...