DataImporter - Import departments


Table of contents


This article explains how to import departments in Octopus.




What you need to know:

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

Required Fields

  • Name - Text (100)
    • Represents the department name.
    • This field will be mandatory when importing departments if the identification is based on the name.
  • Number - Text (100)
    • Represents the department number.
    • This field will be mandatory when importing departments if the identification is based on the number.

Optional Fields

  • Manager – Text (100)
    • Represent the department manager.
    • The user must already exist in Octopus and be uniquely identifiable for this section to work. 
    • The identification method of the mananger is defined with the ManagerIdentificationMethod tag.
  • ParentDepartment - Text (100)
    • Represents the parent department of a specified sub-department. 
    • The parent department must be specified with the same idenfitication method. (By name or number).
  • CostCenter  - Text (50)
    • Free text field to allocate a cost center to the department.
    • The cost center field will only be available if the cost center mode has been activated in Octopus.

Configuration File (XML)

The indication of the source is done by indicating the Department value in the <Content> tag.

NOTE: The XML file used in this example is for an import done from Excel 2007 or 2010.


<?xml version="1.0" encoding="utf-8" ?> 
<Source Name="ImportDepartment">
<ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Import\Departments.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";</ConnectionString>
<ViewName>[Import Departments$]</ViewName<Content>Department</Content

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.

Information on Additional Tags

To import departments, the XML file can contain 3 additional tags. These tags are not mandatory and if they are not specified, the default values will be used.

Department identification method

In the XML file used to import departments, it is possible to specify how the departments and the parent departments are found.

Accepted values for the DepartmentIdentificationMethod tag are:

  • DepartmentByName (Default value): Uses the department name.
  • DepartmentByNumber: Uses the department number.

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


Department manager Identification Method

It is possible to specify how the department manager will be found in the data source. If this tag is not specified, the default used value will be the Windows username. 

Accepted values for the tag MainContactIdentificationMethod are:

  • UserByExternalID : Unique Octopus external identifier of the manager.
  • UserByID : Manager employee number.
  • UserByName : First and last name of the manager (In the John Smith format).
  • UserByWindowsUsername (Default value) : Manager's Windows username.

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


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 exept:

  • 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 emptied.
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing values in Octopus will be kept.

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

Help us improve our articles

Help us improve our articles