Skip to content

Commands

Nathan Dickerson edited this page Jan 11, 2019 · 26 revisions

Before You Start

  • In order to run the tool, you must have the JAR file extracted from the zip file, a .properties file and a CSV file.
  • Before running the tool, open the command prompt and navigate to the Data Loader project.
  • All commands need to be prefaced with dataloader

Template

Using the "template" command allows a user to generate a template for the entity passed in the command line arguments. To generate a template for a particular entity, you will need the name of the supported entity.

The generated template file will have the naming scheme of <Entity>Example.csv. This file will be located inside your current directory.

The template file is populated with two rows:

  • The first row contains all fields (headers) that are found within our REST-SDK for that particular entity. These columns are not all required, they are only meant as potential columns you could include in your particular CSV input file.

    • Some fields are association fields. These can be identified by the "." in the field, for example: categories.id. The associated field (the right side of the ".") can be changed to any field in that associated type, for example: categories.name. DataLoader uses this associated field to find the associated record(s) to associate to the entity that is being inserted/updated in each row. In general, you will want to change associated fields to something other than the default Bullhorn internal ID field.
  • The second row contains the data types associated with each field. This row is for reference purposes only as you construct the CSV input file with your actual data.

Load

dataloader load path/to/.csv

For example: dataloader load C:/Projects/dataloader/data/JobSubmission.csv

dataloader load path/to/directory

For example: dataloader load C:/Projects/dataloader/data

Using the "load" command you are able to insert new records and update existing records in the Bullhorn CRM. To load a csv file using DataLoader you will need to have the name of the supported entity you are loading at the beginning of the csv file name (eg Candidate.csv, ClientContactForDataLoader.csv). If the entity name is not specified at the beginning of the file name an unknown entity error will occur.

Note: When loading ClientCorporations, if an externalID is set for a newly created ClientCorporation, then the defaultContact associated with that corporation will have it's externalID set to the same externalID, but prepended with the word: defaultContact.

Updating Custom Objects

  1. Update your properties file to add a custom object exist field to use when looking up your custom object to update, such as: clientCorporationCustomObjectInstance3ExistField=id (if you were working with the 3rd custom object instance for client corporations, and wanted to only update by the Bullhorn Internal ID)
  2. Setup your clientCorporationCustomObjectInstance3.csv with 3 requirements:
    1. An ExistField column matching the custom object exist field in your properties (ex: id)
    2. A parent entity exist field column (ex: clientCorporation.id, or clientCorporation.externalID, or whatever your parent exist field is)
    3. Any field column(s) on the custom object instance you are updating (ex: text1, text2)

Export

dataloader export path/to/.csv

For example: dataloader export C:/Projects/dataloader/data/JobSubmission.csv

dataloader export path/to/directory

For example: dataloader export C:/Projects/dataloader/data

Export is a backup, or undo button for mass updating data. Saves the current state of existing records that will be updated by the Load command. Requires the same CSV input file or directory as load, and requires that duplicate checking using the <EntityName>ExistField property in the dataloader.properties file is enabled.

Export as Backup before Load

  1. Enable duplicate checking using the <EntityName>ExistField property in the dataloader.properties file.
  2. Prior to performing a load, replace the command load with export, keeping the filename or directory argument the same.
  3. The results/export_<filename>_success.csv file created will contain the current state of existing records for the given columns.
  4. Perform the load command on the original file, which will update the existing records found with new values for the given columns.
  5. Rollback changes by performing load on the results/export_<filename>_success.csv file, which will update the existing records found with the original values for the given columns.

Delete

dataloader delete path/to/.csv

For example: dataloader delete C:/Projects/dataloader/data

dataloader delete path/to/directory

For example: dataloader delete C:/Projects/dataloader/data/JobSubmission.csv

The command is used to delete records from Bullhorn based on a file or directory with files. The records can be deleted either by specifying an external ID or the Bullhorn-assigned ID. See Load Insert vs Update above for more information on specifying the external ID or the Bullhorn-assigned ID.

Note: If a JobSubmission is deleted (soft-delete), then DataLoader will also delete any JobSubmissionHistory records that exist for that JobSubmission as well (hard-delete).

ConvertAttachments

dataloader convertAttachments path/to/.csv

For example: dataloader convertAttachments C:/Projects/DataLoader/Candidate.csv

The "convertAttachments" command gives the capability to convert a locally stored file to html. The supported file types that can be converted are: txt, doc/x, opend, odt, rtf, html and pdf. The format of the CSV dataloader will be reading from is identical to the format of the CSV for LoadAttachments.

When convertAttachments is run, a new folder will be created named convertedAttachments. Within this folder a subfolder will be created which will be named after the entity these converted attachments are to be associated to, such as Candidate. Within this entity folder will be the converted attachments. The name of each attachment will be the same as the externalID of the record to which the attachments will be associated, such as <ExternalID>.html which needs to be associated in the CSV dataloader reads from.

An isResume column is required in order for files to be converted. If a row contains the value 1 or true in the isResume cell, that row will be converted. If you have more than one file for the same entity with isResume set to true, only the last one will be used.

This action will need to be followed by the load command. When the load command is run, dataloader will check the convertedAttachments folder that was created and load any converted attachments that match an externalID in the CSV being read from.

All converted attachments will be pasted into the description field of the entity. Currently, the only supported entities to load converted attachments are: Candidates, ClientContacts and ClientCorporations.

LoadAttachments

dataloader loadAttachments path/to/.csv

For example: dataloader loadAttachments C:/Projects/DataLoader/Candidate.csv

The "loadAttachments" command allows you the ability to load a file stored locally to an existing record in the Bullhorn CRM. Within the CSV, the relativeFilePath column of the file attachment you are uploading and attaching must be specified along with the selector field (for example: candidate.externalID) of the entity the attachment is to be associated with.

Since the attachment process is updating an existing entity and not inserting a new entity, the <Entity>ExistField in the properties file must be set. The <Entity>ExistField property must match the selector column in the CSV file. An example of this format can be seen in the examples/loadAttachments folder. Before the CandidateAttachFile.csv example will work (which has the first column: candidate.externalID), you must uncomment the line: candidateExistField=externalID in the properties file.

DeleteAttachments

dataloader deleteAttachments path/to/.csv

For example: dataloader deleteAttachments C:/Projects/DataLoader/Candidate.csv

The "deleteAttachments" command provides the ability to delete a file stored to an existing record in the Bullhorn ATS/CRM system.

Help

When the help command is invoked a list of suggested actions will be returned and the format required for each action.