Auto-Import Directory
Previous Topic  Next Topic 

Auto-Import Directory

The auto-import directory provides another way for you to import data into Pacific Timesheet. When CSV files are dropped into the auto-import directory they will be automatically imported into the system. The format of the import files is exactly the same as when you import through the web browser. For information about the CSV import file format see the Importing/Exporting topic.


Note: Cloud systems support auto-importing from FTP sites only (via FTP/FTPS protocol). Self-hosted systems can additionally auto-import files from file system directories.


To set up a directory for auto-importing you need to configure the following properties:

Property

Description

Enabled

Check this option to enable auto-importing.

Import From

You have the option of importing from a directory on the computer running the Pacific Timesheet service (self-hosted only), importing from an FTP (File Transfer Protocol) server, or importing from a Dropbox folder.


If you choose "FTP Server" the following properties must be configured by clicking the settings button that appears to the right of the menu:

FTP Server

The host name or IP address of the FTP server.

Login

The user account or login name for the FTP server.

Password

The password for the login, above.

FTP Directory

The directory where export files will be created, e.g. "/" or "/tmp". FTP server paths start with a forward slash, and backslashes are not valid. If blank, the root directory will be used, which is equivalent to "/".

FTP Port

The port number for the FTP server, where 21 is the default value for most FTP servers.

FTP Mode

Check this option to enable passive mode, which aids when transferring files through firewalls.

Security

If the FTP server has connection security enabled you will need to set the appropriate value here. Your options are:

None

No connection encryption

Implicit SSL

Implicit Secure Socket Layer encryption (FTPS)

Explicit SSL

Explicit Secure Socket Layer encryption, also known as (FTPES)


If you choose "Dropbox" you can import the data from a Dropbox folder of your choosing.  Click the "Link New Account" button to open a web page that gives you the option to allow Pacific Timesheet to access the Dropbox account (you will be prompted to log into Dropbox if not already logged in). When you click "Allow" you will be given an authorization code.  Select and copy this code, then switch back to Pacific Timesheet and enter the authorization code into the dialog.


Once you have saved the configuration, Pacific Timesheet will create a "PacificTimesheet" folder within the "Apps" folder in the Dropbox account.  Pacific Timesheet will only be able to see files within this folder.  You can further specify a sub-folder within this folder: for instance, if you specify a sub-folder named "imports" then there would be an "/Apps/PacificTimesheet/imports" path created in the Dropbox account, and only that folder would be scanned for import files.

Directory

The directory on the computer or FTP server from where the export files will be imported. If the "Import From" property is set to "Directory" then this is the file path to the directory where the import files will be replaced, e.g. "/tmp", "c:\imports" or "\\morpheus\\c\imports". The path must be valid for the server that Pacific Timesheet is installed on.

If the "Import From" property is set to "FTP" then this is the directory on the FTP server from where you want to read the import files, e.g. "/" or "/tmp". FTP server paths start with a forward slash, and backslashes are not valid.

If the "Import From" property is set to "Dropbox" then this will be the optional sub-folder within the Dropbox account to scan for import files.  The sub-folder will be created directly under the /Apps/PacificTimesheet folder of the Dropbox account.  If left blank then files will be scanned for in the /Apps/PacificTimesheet folder of the Dropbox account.  Import files in folders below the specified sub-folder will be ignored - only the top level will be scanned.

When Finished

This option determines what to do to the file when finished, so that it will not be reprocessed. The following options are available:


Delete

Delete the file after successfully importing the data.

Rename

Rename the file by appending ".fin" after successfully importing the data.



File Naming


Import files need to be named in a specific way in order for the system to know how to process it:


1. The file name must end is ".csv"


2. The file name must start with the type of objects being imported, then a hyphen, then the key field, and finally a hyphen:


       objects-keyfield-*.csv


The first part, 'objects', is the type of objects being imported, such as employees or tasks. The next part, 'keyfield', is the object property to use to avoid creating duplicates, for instance name or id. The '*' is a wild-card indicating that any valid file name text can appear after the hyphen. For example, to import employees using the login name as the key field the following file name would be appropriate:


       employees-login-myemployees.csv


The following tables lists the objects that can be imported, along with their supported key fields.


General Imports:


Object

Key Fields

Notes

employees

login, id, email

If you renamed employees using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "resources-login-.csv", "resources-login-xyz.csv", etc.

employeebalances

(none)

No key field needed.


If you renamed employees using the terminology feature then replace 'employee' with your singular terminology, making sure to remove spaces, if any, in the name. For example: "resourcebalances-.csv", "resourcebalances-xyz.csv", etc.

groups

name, id


timesheets

(none)

No key field is needed in the file name, but if the import file specifies the ID column then that will be used to match to a possible previously existing entry.


File name examples: "timesheets-.csv", "timesheets-xyz.csv", etc.

billrates

(none)

No key field needed. For example: "billrates-.csv", "billrates-xyz.csv", etc.

payrates

(none)

No key field needed. For example: "payrates-.csv", "payrates-xyz.csv", etc.


Work Breakdown Structure (WBS) Imports:


Object

Key Fields

Notes

customers

name, id

If you renamed customers using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "clients-name-.csv", "clients-name-xyz.csv", etc.

projectgroups

name, id

If you renamed project groups using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "portfolios-name-.csv", "portfolios-name-xyz.csv", etc.

projects

name, id

If you renamed projects using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "jobs-name-.csv", "jobs-name-xyz.csv", etc.

taskgroups

name, id

If you renamed task groups using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "phases-name-.csv", "phases-name-xyz.csv", etc.

tasks

name, id

If you renamed tasks using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "activities-name-.csv", "activities-name-xyz.csv", etc.


Asset Imports:


Object

Key Fields

Notes

assets

name, id

If you renamed assets using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "jobmaterials-name-.csv", "jobmaterials-name-xyz.csv", etc.

assetclasses

name, id

If you renamed assets using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "jobmaterialclasses-name-.csv", "jobmaterialclasses-name-xyz.csv", etc.

assetentries

(none)

No key field is needed in the file name, but if the import file specifies the ID column then that will be used to match to a possible previously existing entry.


If you renamed assets using the terminology feature then use your plural terminology, making sure to remove spaces, if any, in the name. For example: "jobmaterialentries-.csv", "jobmaterialentries-xyz.csv", etc.



Note that these file naming conventions are case-insensitive!



Logging and Error Handling


An import log file will be generated in the auto-import directory, with details about what was imported, and any errors that might have occurred. Up to 7 days of log files will be generated - older ones will be deleted automatically.


If any errors occur during the import, the import file will be renamed by appending ".err" to the file.