Using the CSV import feature

Using the CSV import feature

  • Comments 14
  • Likes

Neil Lydick, one of our developers, wrote an excellent document containing overview and how-to information for importing information using a Comma Separated Value (CSV) file. This feature can be used to:

·         Create Configuration Item or Work Item instances from data stored in a tabular format

·         Bulk-edit existing database instances

·         Populate the SMCMDB with data exported from an external database

·         Circumvent data entry through forms when many class instances must be created at once

To see the full document, click the title of this post and check out the attached file. If you're reading this post through an RSS feed, you'll need to click through to the Service Manager Blog to see the attachment.

 [Edit: If you've noticed a lack of Appendix A in your document, grab that in my subsequent post, here: http://blogs.technet.com/servicemanager/archive/2009/05/26/appendix-a-to-previous-post.aspx ]

Attachment: CSVImport.docx
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • PingBack from http://blogs.technet.com/servicemanager/archive/2009/05/26/using-the-csv-import-feature.aspx

  • I neglected to attach the Appendix A, an HTML list of classes, to the previous post about Using the CSV

  • how do I import a CSV for change request and indecent which have different headers as defined in the PROPERTY IDs of System.WorkItem.ChangeRequest and System.WorkItem.Incedent?  

  • About CSV import from the SCSM Console:

    It does have some downsides at the moment, e.g.

    - I didn't manage to change the delimiter character - that's not very convenient, especially considering that the commas in strings are still interpreted as column breaks by the parser

    - When creating CSVImporter for a class which had enum "Category" with long entries(over 75 chars), the task failed unexpectedly. All the others enum fields imported just fine. I located the problem with that field by isolating the values which caused the import failure.

    - When importing already existent objects to update them, they get completely overridden by the new set of values(most of them unspecified in my case). My intention is to only update several fields in each object, and to preserve the others. Am I doing something wrong or how do I do that?

    Hope this will help with your work

  • This will not start running.  Am I missing something.  I put 5 min and it never runs.  I then tried 1 min and still nothing happens.

    Thanks.

  • What about passing properties in the Change RequestProjection for class extensions? do you use something like:

    CSVImportFormat>

     <Projection Type="System.WorkItem.ChangeRequestProjection">

       <Seed>

       <Class Type="System.WorkItem.ChangeRequest">

           <Property ID="ID"/>

           <Property ID="Priority"/>

           <Property ID="Impact"/>

           <Property ID="Title"/>

        </Seed>

       <Seed>

         <Class Type="ClassExtension_61fce80a_dbdd_4532_b233_ce50c9f7a3c6">

           <Property ID="SomeCustomPropertyInternalName"/>    

        </Seed>

    </Projection>

    </CSVImportFormat>

    Then how about adding a Manual Activity to be created with each new CR work item? How would you go about including the XML for that? I want to create a series of CRs from CSV, but they need to include class extensions and also manual activities for each CR. Thanks

  • Disregard previous comment... I figured it all out and got it to work. Excellent Blog, thanks. I found  the Appendix of Class Structure very useful dureing my adventure, but was able to load 800 Change Requests from a legacy system via this CSV import feature.

  • @Greg -

    Impressive!  Nice work!

  • Would this be a good method to import hardware that doesn't get tracked using Configuration Manager? I need to find a way to associate items like TV's, Computer Monitor Make\Model, desktop switches, some USB Devices, etc. I was thinking after importing these, then I can add the items using the configuration items in the "Related Items" tab in SCSM. Thanks

  • @Tom Pagel -

    yes, this is one good way to get those types of objects in the database.  Also check out the data management solution from Provance.  It makes it easier to map the data instead of trying to figure out how to do it in XML.

  • I have successfully imported Incident and Problem data for a migration project.  However the documentation does not seem to include any ProjectionType or class for Service Requests.  Is there a restriction or a specific method for Service Requests?

  • @Rob -

    No, nothing special for service requests.  It's just that at the time this document was created we didn't have service requests in SCSM yet.

  • Thanks.  Where can I find the attributes for Service Requests?

  • Error: Could not import the row on line 1 of CSV file C:\Users\scsmadm\Desktop\import file\newcomputers.csv. Object creation failed with the following error:

    --> Exception of type 'Microsoft.EnterpriseManagement.CSVImport.CSVInstanceException' was thrown.

     i do both csv file and and xml