Question
How do I use Connector Solution 6.5 to import data into a custom data class?
Answer
A Connector Solution data source and import rule can be used to import data from an external source, such as from a spreadsheet or a staging database, into custom or out of the box data classes. For example, you might have a list of smart phones in a file that you want to import in as assets. This article describes how to perform these procedures.
Note: The examples in this article assume that you have completed the previous examples from the following related article:
How to use CMDB Solution 6.5 to create a custom data class and associate it with a custom resource type
http://www.symantec.com/business/support/index?page=content&id=HOWTO1171
Part One: Create an Import File
Note: If you will be using an existing import file or staging database instead of creating one, skip to Part Two.
- Using a text editor, create a new .CSV file and add the following text to it:
Name, Serial Number, Megapixel Size
Smart Phone 1, 123XYZ, 3.2-MP
Smart Phone 2, 456XYZ, 2.0-MP
Smart Phone 3, 789XYZ, No built-in camera
- Save the file as "C:\connector_import.csv".
Part Two: Create a Data Source
- To create a data source, in the Altiris Console, go to Configuration > Solution Settings > Connectors > Data Sources.
- Right click on the Data Sources folder and choose New > CSV File Data Source. Note: If you will be using a different import type, select this instead. For example, OleDB Data Source can be used to access a Microsoft Excel file.
- Type a value for the Name field. For example, "Smart Phone Data Source".
- Click on Allow Imports to enable it.
- Click on the Browse button for the Import file.
- Find and select the import file to use from Part One. Note: If you will be using a different import file, select this instead.
- Click on the Open button.
- Click on the Test Data Source button. This should display "Details have been saved. Test successful." If not, double check the import file's data for accuracy. Note: Ensure that unique values are present for any required fields, such as serial number, barcode number, and system number. Also ensure that there are no blank rows. If there are non-unique or blank values present, unexpected results will likely occur.
- Click on the Apply button. This displays "Details have been saved."

Part Three: Create an Import Rule
- To create an import rule, in the Altiris Console, go to Configuration > Solution Settings > Connectors > Import/Export Rules.
- Right click on the Import/Export Rules folder and choose New > Resource Import Export Rule.
- Type a value for the Name field. For example, "Smart Phone Import Rule".
- Select a value for the Data source field. For example, "Smart Phone Data Source" created in Part Two.
- Select "Import" for the Replication direction field.
- Select a resource type for the Resource type field. For example, select "Smart Phone".
- Click on Column Mappings to expand that section. Column mappings will attempt to automatically match up the data source columns with data classes. For example, if using the Smart Phone examples, "Serial Number" should be matched up with "Serial Number", and "Megapixel Size" should match up with "Camera Specification". If the custom data class does not appear, continue with step 7a, otherwise skip to step 8.
a. Click on "Select a data class" for the Data Class Mappings field.
b. Select the custom data class under the resource folder it is saved under. Note: A custom data class must be mapped to the resource type selected in step 6 otherwise it will not be able to be selected. Also, when using the Resource Association Selector, the Search box will only search the currently selected Group. This does not recursively search all available data classes.
c. Click on tyhe Apply button.
- Select "Serial Number" for the Resource Lookup Key.
- Select "Name" for the Resource Name.

- Click on the Test Rule button. This should display an execution window with results. If the Smart Phone examples are being used, this should show three rows of data processed, and three resources created. Note: If this does not show the expected results, either the import file has non-unique values (the import rule can't match the data up), and/or the column mappings are incorrect, such as the wrong resource lookup key or resource name were used. Click on the View full log link for additional troubleshooting information.

- Click on the Close button.
- Click on the Apply button. This displays "Details have been saved."
- Click on the Run Now button. The same results as step 10 should be shown.
- Click on the Close button.
Assuming that all the examples were followed, to see the new imported data, go to Resources > Resources > Configuration Items > Asset Types > User Defined > Smart Phones. The three new imported Smart Phone resources should appear in the list.

For more information on how to using Connector Solution data sources and import rules, please refer to the Connector Solution Product Guide, starting on page 18:
CMDB Solution 6.5 Product Guide
http://www.symantec.com/business/support/index?page=content&id=DOC1506
For additional related procedures, please refer to the following article:
How to create a CMDB Solution 6.5 custom report that uses a custom data class
http://www.symantec.com/business/support/index?page=content&id=HOWTO10517