DataImporter - Import Parts

Table of contents

Introduction

This article presents the information on importing spare parts to supply the CMDB with the inventory.

References

 

What you need to know:

The reference template files (.xlsx et .xml) to prepare imports are included in the Parts.zip file.

Required Fields

  • Number - Text (250)
    • Unique identifier for the part
  • Description - Text (250)
    • Name or description of the part

Optional Fields

  • Manufacturer - Text (500)
    • Represents the manufacturer of the part
    • When there is a model, this field becomes mandatory
    • The system will create the supplier during import if it does not already exist
    • This information is related to the supplier module. For more information, refer to the Import suppliers article
  • Model - Text (50)
    • Represents the part model and is always linked to the manufacturer
    • The system will create the model if it does not already exist
  • ManufacturerPartNumber - Text (250)
    • This field is used to identify the manufacturer's number of the part
    • The manufacturer is mandatory when the the ManufacturerPartNumber is present
  • Supplier - Text (500)
    • Part supplier. Generally the vendor of the part
    • The system will create the supplier during import if it does not already exist
    • This information is related to the supplier module. For more information, refer to the Import suppliers article
  • Cost - Decimal
    • Cost of the part per unit
    • The value must be between 0 and 9 999 999.99
    • Example : 1234567.89
  • MinimumQuantity - Whole number
    • Minimum quantity to keep in stock
    • Example: 25
  • QuantityInStock - Whole number
    • Present quantity in stock
    • Example: 40
  • Location - Text (100)
    • To indicate where the part is stored
  • CostCenter - Text (50)

    • Part cost center

  • ResponsibleGroup - Text (50)

    • ​Octopus user group reponsible of managing this type of part

    • This group must already exist

  • Category - Text (100)

    • ​Part Category defined by the Octopus Administrator. The option is accessible from the Tools > Reference data management >  Parts > Category

    • The system will create the category during import if it does not already exist

  • ​​QuantityToOrder - Whole number

    • ​Quantity to order

  • Format - Text (100)

    • ​Part unit 

    • Example: box, pack of 10, etc

  • UsedInPreventiveMaintenance - Boolean

    • Indicates that the part is used in preventive maintenance

    • Accepted values are: 1 or 0, True or False, Oui or Non

  • IsActive - Boolean

    • ​Indicates if the part is active

    • Accepted values are: 1 or 0, True or False, Oui or Non

  • ExternalIdentifier - Text (50)

    • Part number from an external system used for import 

  • Note - Text (5000)
    • Note tab of the part.
NOTE: This field replaces the existing data at each import. The program does not add the information, but replaces it.

Configuration File (XML)

The declaration of the source is done by indicating the PART value in the <Content> tag.
 

NOTE: The XML file used as this example is for an import done from Excel 2007 or 2010. To explain the tags used in all types and to find out more about the types of files, please refer to the XML Configuration File article
<?xml version="1.0" encoding="utf-8" ?>

<Sources>

   <Source Name="Import Parts">

      <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Import\Parts.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>

      <ViewName>[Import Parts$]</ViewName>

      <Content>PART</Content>

      <EmptyValueHandling>NoChange</EmptyValueHandling>

   </Source>

</Sources>

Information on Additional Tags

To import parts, the XML file can contain 1 additional tag. This tag is not mandatory and if it's not specified, the default value will be used. 

Management of Empty Fields

DataImporter can help clean the data contained in Octopus when empty fields are encountered. If this tag is not present, the NoChange default value will be used. 

If you want to use this tag as part of an import, it is important that your data source only contain columns to act on. DataImporter will systematically try to clean all these columns. You can clean all fields except:

  • Required fields
  • Fields that have been configured as mandatory in the Octopus database
  • Fields that accept only specific values, for example boolean type fields (yes/no).

Permitted values for the EmptyValueHandling: tag

  • Clear: The existing value in Octopus will be cleared and the field will be empty
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing value in Octopus will be kept.

To use this tag, add the following line to the XML file : 

<EmptyValueHandling>VALUE</EmptyValueHandling>
X
Help us improve our articles








Help us improve our articles