How to create a Workflow Task to map and import Consignments from a Delimited File

How to create a Workflow Task to map and import Consignments from a Delimited File

The workflow task in MachShip allows you to define field mappings between MachShip fields and data fields from a selected file type such as CSV or XML.

How to navigate to create a Workflow Task

 

To navigate to Workflow Results select Admin and Other Options.

Then select Workflow Task.

From this page, you can create a new workflow task by clicking on the Create Workflow Task button at the top of the screen.

Create a Workflow Task screen

In order to generate a workflow task, you will need to enter the following fields:

  • Name and Abbreviation - This are free text fields and will be used to identify or search for the workflow task.
  • Company - use/type in the company name that will use the workflow task.
  • Is Inheritable - set to Yes, should you wish to allow your child companies to be able to access and assign these workflow.
  • Is Enabled - set to Yes, to actively use the workflow and No to disable.

    Note: Once you choose a Task Type and a Mapping Type, you will not be able to change them. If the selected type is incorrect, the only way to change it is to start the process over.

  • Workflow Task Type/s - which can be either:
    - Consignment Importer - for importing consignments data.
    - Invoice Importer - for importing invoice data.

In this instance, you can select the preferred task type under the workflow task type which can be Consignment Importer or Invoice Importer.

  • Mapping Type

Since you are going to import a delimited file, please select Delimited File Mapper.

Once you have chosen the Delimited File Mapper as the Mapping Type, you will see a new section called Workflow Task Options as shown below:


For delimited file type, you can adjust several configuration variables:

  • Rows To Skip

By default, it is set to 0, meaning there is no row to skip. When your file has some redundant information, for example, lines that contain the report title or author info, you can skip those lines and enter in this field the number of lines you want to skip. Note that blank lines are automatically skipped. 

  • Rows To Skip at End

By default, it is set to 0, so similar to rows to skip, there is no row to skip at the end. When your file has some data at the end, for example, an extra total line, then it is time to enter in this field the number of lines you want to skip. Note that blank lines are automatically skipped. 

  • Contains Headers

When your file has headers, you can view each row in the file as a map instead of as an array of strings. Enabling this option helps you to access specific fields by their corresponding column name.

  • Delimiter

It is an optional field and if left blank the expected delimiter is a comma (CSV file). If you have the file delimited by another field please just place the character in the box provided.  

  • Trim Fields

Enable this option if you want MachShip to remove redundant white space before and after the field value.

  • Fail on Missing Field

When this option is on, the import process will fail if there are missing fields.

  • Fail on Missing Header

If the mapping is based on the header and the file doesn't contain it, then the import will be failed if the option is turned on.

  • Quote all fields

This option will place quotes around all the fields being imported into MachShip

  • Ignore Bad Data

 The Ignore Bad Data option will ignore the line/field if there is bad data sent through. 

  • Ignore Quotes

 The Ignore Quotes option will ignore and remove the quotes if they are within the delimited file. 

Define Mapping:

The next step is to define all the property map options. Please click on the Add Property Map Option button to add a new property/field mapping.



For each property mapping, you will need to fill in the following info:

  • Location

Specify which part of the file to take the information from.

  1. Body: Take the information from within the file contents. It is the most common location.

  2. File Name: Take the information from the file name.

  3. Extension: Take the information from the file extension.

  4. File Name and Extension: Take the information from the combination of the file name and the file extension.

  5. Constant Value: Specify that the information is a constant value, the value is defined in the Map From column.

  6. Company: Take the company from the name of your current company.

  7. Base Company: Take the information from the name of your base company.

  8. User: Take the information from your user display name.

  9. Constant Location: Take the information from a constant location from the selected file.

  • Mapping Target

Depending on your import type, there will be a list of properties in MachShip that you can map a location property to.

  • Mapping From

You need to define how to read the value and map into the target. Typically for the delimited file import, it will be the header name when the file contains headers. When there are no headers, the best input is the index position of the property.

  • Ignore Row if Empty

If you file will likely contain some lines or tag collection which do not relate to data you wish to import set this flag as being "Yes"MachShip will then ignore all the data related to this collection of tags or row in the file, allowing you to import the other data. 

  • Pattern and Replacement

Only use this option when you want to use Regular Expression to determine whether to replace the original field value with a different value. The regular expression functionality will also allow you to undertake direct replacement. For example - set the field you wish to replace in the box on the left and what you wish to replace it with, in the box on the right. 

For example - the input below will replace every term of Startrack with the expected abbreviation in MachShip of STRACK for the carrier Startrack. 


Mapping Targets

To successfully set up and import a CSV file as a consignment, you need to make sure the file has all the required fields. To create a consignment, we will need the following info:

  • Despatch date
  • Despatch time
  • Carrier: It needs to be the carrier abbreviation
  • Account: It needs to be the account abbreviation
  • Service: It needs to be the service abbreviation
  • From location name
  • From Abbreviation
  • From contact
  • From phone
  • From address line one (Required if you are not mapping a company location name)
  • From address line two
  • From suburb (Required if you are not mapping a company location name)
  • From postcode (Required if you are not mapping a company location name)
  • To location name
  • To Abbreviation
  • To contact
  • To phone
  • To address line one (Required if you are not mapping a company location name)
  • To address line two
  • To suburb (Required if you are not mapping a company location name)
  • To postcode (Required if you are not mapping a company location name)
  • Special instructions
  • Reference one
  • Reference two
  • Item quantity (Required if you are not mapping a company Item)
  • Item SKU
  • Item description
  • Item type (Required if you are not mapping a company Item)
  • Item length (Required if you are not mapping a company Item)
  • Item width (Required if you are not mapping a company Item)
  • Item height (Required if you are not mapping a company Item)
  • Item Reference - This will be the item Identifier / Barcode on the label
  • Carrier Consignment Id - Set this if you are telling MachShip the Consignment Number. 
  • Company - If you need to set the company for the consignment that is imported
  • Questions - If you wish to set a Routing Question through import
  • Printer Token 
  • Staff Member Name
  • Is Receiver Account - If the consignment is receiver pays - will need to work in conjunction with the Receiver Account Code
  • Receiver Account Code
  • Is Existing Consignment - If the consignment being created is a benign or existing consignment
  • Serialised Settings - Allows the setting of consignment specific options

The fields in bold are all required if you are importing as a consignment. Note the fields in italics are only required if MachShip cannot obtain this data from the saved company locations or items. 

If you are intending to import to a pending consignment there are no required fields but the more information provided the easier it will be to finalise the consignment. 

An example of how to import a CSV file as Consignments

See an example CSV file below.

Date,Carrier,Account,Service,Location Name,To Location Name,Reference,Quantity,Item name,Type,Length,Width,Height,Weight
30/08/2018,IPEC,MACBRO_IPEC,X,Melbourne Warehouse,Machbro Head Office & Bulk Warehouse,12347,1,Hoppt Petrol Power Drive Unit,Pallet,100,70,15,10
30/08/2018,IPEC,MACBRO_IPEC,X,Melbourne Warehouse,Machbro Head Office & Bulk Warehouse,12347,3,Hoppt Submersible Pump,Pack,100,50,25,26



The CSV file contains the following fields:

  • Date
  • Carrier
  • Account
  • Service
  • Location Name
  • To Location Name
  • Reference
  • Quantity
  • Item name
  • Type
  • Length
  • Width
  • Height
  • Weight

A valid setup would look like this: 

There are a few notes with this mapping option:

  • Date Format

    When mapping a date field, you need to let MachShip know the date format. In this example, since the date is in Australian format, the correct value is dd/MM/yyyy, if it is an American date, then the value would be MM/dd/yyyy. 

    Note that this field can be left blank if the date format will vary. 

  • Using constant value

    My CSV file doesn't have a valid value for the Company, so in this case, I use a constant value.



  • Item dimension

    For some properties, you will need to instruct MachShip on how to get the value correctly. 



Note: Should your file not have headers, you can use the index of the column to indicate to MachShip which column to obtain the data from

Once all of the options have been populated, please click on the Create Workflow Task button and the workflow task will be created. 

    • Related Articles

    • How to create a Workflow Task to map and import an XML file

      How to navigate to create a Workflow Task To navigate to Workflow Results select Admin and Other Options. Then select Workflow Task. From this page, you can create a new workflow task by clicking on the Create Workflow Task button at the top of the ...
    • How to create a Grouper Workflow Task

      By default, when importing files into MachShip the system will create a new invoice entry, consignment note or pending consignment for each line on a CSV or unique set of tags in an XML. In some circumstances, multiple lines will need to be ...
    • How to Create a Consignment or Carrier Invoice Importer Workflow (Create a Workflow)

      MachShip provides users with the ability to map up well structured internal files, or specialised carrier invoice templates to import, in order to reconcile carrier invoice charges or create consignments. These customised mappings are known as ...
    • How to test a Workflow

      In order to ensure that your Workflow is mapping and grouping all fields correctly, it is important to test your workflow mapping. This testing is undertaken via the workflow test module in the Manage Workflows section of MachShip. How to navigate to ...
    • How to assign a Workflow to a Company

      In order to enable a company to be able to use a workflow, it needs to be assigned to a company. This is completed through the Edit Company Page. How to navigate to the Edit Company Page Select Admin and View Companies. Search for the company you ...