Before we can start creating the export we need to analyze the issue we are trying to solve.
At its simplest you can work through a few easy questions to get you started:
When would you like to export the data? To run a data export, we need a trigger event. Some examples of a trigger event are such as a failed delivery, when a driver leaves the depot, when freight isn't delivered and returned to the depot
How often would you like to export the data? The data can be exported every few minutes, every hour, every second day, once a month or any other time frame you desire.
What data would you like to send? Consignment updates, proof of deliveries, extra charges, freight scans, photos, runsheets, equipment transactions or anything else TransVirtual tracks and records.
In what format would you like the data? Emailed, Printed, Remote FTP, SMS or Web Service API
Who needs the data you are exporting? A customer, driver, agent, depot manager, accounts staff or manager. The choices are limitless.
A common example might be:
Trigger: A driver selects a 'check address' delivery issue against a consignment in the mobile application
Trigger Period: Check every 2 minutes
Data Required: Consignment Information
Export Framework: Generate an email
Export to: customerservice@yourcompany.com.
This means that every 2 minutes the system will send data for consignments whose status has changed to 'check address' since it last exported. It will email the details to customer service for them to follow up.
Now that we know that the trigger event is a Consignment Status, we can go to the EDI > Data Export > Consignments Status Updates page.
You will be presented with a page that shows all currently setup rules.
Click on the New Rule button and enter a name for the rule and select the Export Framework or method of sending that will be used.
Rule Name: Check Address Email
Export Framework: Email
Click on the Create button to create the rule.
This will now create a rule and it will be presented in the list on the left in orange. (Orange means the rule is disabled)
Once you select this rule, the right hand side of the screen will be populated with the current configuration of this rule.
Configure the Trigger Period as required. Every 2 Minutes is the Default
Configure the Export Framework to email to the appropriate email address with subject and body.
Select the Export File Type and populate with the required fields
Click the Update button to save these settings.
Configure the Data Filter to "Status Name" "Equals" "Mobile - Check Address"
Go back up to the Rule Details and turn on "Perform a Test Export" and click . This will send a test email with the rules you have setup
Turn on "Enable Export" once ready and click Update to enable this rule.
The FTP export framework allows the transfer of data via an FTP or SFTP Connection.
Configuring the FTP connection requires the following information to be filled out. Most of these settings will be provided by the party hosting the FTP Service.
FTP Server URL: The hostname of the FTP service (i.e. ftp.domain.com)
Username: Username for the service
Password: Password for the service
Port: Defaults for FTP is 21 & sFTP is 22.
FTP Folder: Path to the folder the data will be exported to. (i,e, "POD/photo/in" )
Active Mode: By default, all data transfers are initiated with a PASV transfer, Tick this box to enable Active transfers.
SFTP: Tick this box if you require a Secure FTP connection
Update other configuration that have the same 'Server FTP URL': Tick this box if you would like to update other EDI Export rules that use the same FTP URL
The Email export framework allows the transfer of data via an Email.
There are three main area's to fill in.
Send to Consignment Sender Email: Yes/No
Send to Consignment Receiver Email: Yes/No
Send to Customer Contact: Select the Customer Contact type you would like to receive the email
Email To: Enter one or more email addresses to send the email to.
Subject: Enter the Email Subject you require.
The email body is a text based email that can include variable information about your EDI Rule.
There are 2 types of variable data that can be entered. This is handled using Razor Syntax, if you require a complicated email, don't hesitate to contact the support team to help you understand the syntax.
Field Insertion
Right click in a location you need to enter a field. You will be presented with a menu to select fields. Find you field and select it and it will be presented like follows;
You will need to change the name of the field between the "@" and the "." to be "Model" to look similar to the following;
@Model.ConsignmentNumber
This will enable the output of the field in the location you require on the page.
List insertion
Right click in a location you need to output a list. You will be presented with a menu to select lists and fields. Go into the List menu and select the list type you would like to insert. It will display similar to the following;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
}
Now you need to insert the fields you wish to output within the listed loop, This is done within the "{}" brackets that was inserted above. Right click in there and select the fields required, so it looks similar to the following;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
@consignmentStatus.ConsignmentNumber
@consignmentStatus.ConsignmentCurrentStatusDate
@consignmentStatus.ConsignmentCurrentStatus
}
Within the "{}" brackets if you would like to output text is must be done using a @Raw() command. An example follows;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
@Raw("Consignment Number: ")@consignmentStatus.ConsignmentNumber
@Raw("Status Change Date: ")@consignmentStatus.ConsignmentCurrentStatusDate
@Raw("Status Value: ")@consignmentStatus.ConsignmentCurrentStatus
}
This would output
Consignment Number: CUSTA37157
Status Change Date: 1/09/2017 3:19 PM AEST
Status Value: Assigned
Click the button to check and preview.
Click the button to save your changes.
The email body HTML is the same as the text based email body above but you have the ability to present the email in a much nicer format with images etc.
You can still insert the same variable information into a HTML Email.
The Print export framework allows the printing of data to a printer configured in the software.
The SMS export framework allows the transfer of data via an SMS.
Send to Consignment Sender Phone: Yes/No
Send to Consignment Receive Phone: Yes/No
Send to Customer Contact: Select the contact type you require from the Customer Contact List
Mobile Number: Enter a mobile number for the required contact
SMS Message: SMS Message can be a simple text or can also include variable data.
There are 2 types of variable data that can be entered. This is handled using Razor Syntax, if you require a complicated SMS, don't hesitate to contact the support team to help you understand the syntax.
Field Insertion
Right click in a location you need to enter a field. You will be presented with a menu to select fields. Find you field and select it and it will be presented like follows;
@consignmentStatus.ConsignmentNumber
You will need to change the name of the field between the "@" and the "." to be "Model" to look similar to the following;
@Model.ConsignmentNumber
This will enable the output of the field in the location you require on the page.
List insertion
Right click in a location you need to output a list. You will be presented with a menu to select lists and fields. Go into the List menu and select the list type you would like to insert. It will display similar to the following;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
}
Now you need to insert the fields you wish to output within the listed loop, This is done within the "{}" brackets that was inserted above. Right click in there and select the fields required, so it looks similar to the following;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
@consignmentStatus.ConsignmentNumber
@consignmentStatus.ConsignmentCurrentStatusDate
@consignmentStatus.ConsignmentCurrentStatus
}
Within the "{}" brackets if you would like to output text is must be done using a @Raw() command. An example follows;
@foreach(var consignmentStatus in Model.ConsignmentStatusChange){
@Raw("Consignment Number: ")@consignmentStatus.ConsignmentNumber
@Raw("Status Change Date: ")@consignmentStatus.ConsignmentCurrentStatusDate
@Raw("Status Value: ")@consignmentStatus.ConsignmentCurrentStatus
}
This would output
Consignment Number: CUSTA37157
Status Change Date: 1/09/2017 3:19 PM AEST
Status Value: Assigned
Click the button to check and preview.
Click the button to save your changes.
The export file types within TransVirtual allows you to export your data in a customized output through a range of file types.
There are currently 2 base export file types to perform your data export, follow each of the links to see an article on how to configure each of them.
XML/JSON/TEXT/Other
CSV/Excel
The 3rd option allows you to combine the 2 output type above into a single output
CSV and TEXT
This guide will show you how to setup a file export using the CSV/Excel file type export.
The fields required for setup of this file type depend of the EDI Catagory. Some are POD Only related.
Delimiter Char: This is the character that separates the fields within the row. This is commonly a comma.
CSV File Type: Select Standard for CSV, Excel 2003 or Excel 2007
Include Header Row: Tick the box to include a header row
Send PDF Report: Send a PDF of the output file
Send Consignment Image: Tick the box to send an image of the consignment
Send Signature Image: Tick the box to send a signature image
Export POD Image Format: Normal (PNG), Black & White, Group 4 Tiff, PDF
File name format (POD Image): POD image file name that is exported. [number] to display consignment number in file name [ddMMyyyy] to display day, month and year of file export [ddMMyyyyhhmmss] to display day, month, year, hour, min and sec of file export
File name format: XML (or other) file name that is exported. [ddMMyyyy] to display day, month and year of file export [ddMMyyyyhhmmss] to display day, month, year, hour, min and sec of file export
File extension name: The extension of the file type. Defaults to ".csv" can be changed to anything required
Data to export: By default a few common field name will be inserted in this field. The order of these is replicated in the output file. Left click to add a field to the output. You can re-order the fields by dragging the field that requires moving,
Click the button to save your changes.
This guide will show you how to setup a file export using the XML/Json/Text/Other file type export.
The fields required for setup of this file type depend of the EDI Category. Some are POD Only related.
Send PDF report: Yes/No. This is a PDF File of the below File Structure
Send consignment image: Yes/No
Send signature image: Yes/No
Export POD Image Format: Normal (PNG), Black & White, Group 4 Tiff, PDF
File name format (POD Image): POD image file name that is exported. [number] to display consignment number in file name [ddMMyyyy] to display day, month and year of file export [ddMMyyyyhhmmss] to display day, month, year, hour, min and sec of file export
File name format: XML (or other) file name that is exported. [ddMMyyyy] to display day, month and year of file export [ddMMyyyyhhmmss] to display day, month, year, hour, min and sec of file export
File extension name: The extension of the file type. Defaults to ".xml" can be changed to anything required
Strip out whitespace: Yes/No
Strip out new line: Yes/No
File Structure: By default an XML output is created to get you started, this can be modified as suits.
Field Insertion
Right click in a location you need to enter a field. You will be presented with a menu to select fields. Find you field and select it and it will be presented like follows;
@consignmentStatus.ConsignmentNumber
You will need to change the name of the field between the "@" and the "." to be "Model" to look similar to the following;
@Model.ConsignmentNumber
This will enable the output of the field in the location you require on the page.
List insertion
Right click in a location you need to output a list. You will be presented with a menu to select lists and fields. Go into the List menu and select the list type you would like to insert. It will display similar to the following;
@foreach(var pod in Model.PodData){
}
Now you need to insert the fields you wish to output within the listed loop, This is done within the "{}" brackets that was inserted above. Right click in there and select the fields required, so it looks similar to the following;
@foreach(var pod in Model.PodData){
@Raw("<Delivery>")
@Raw("<DeliveryTime>")@Model.ReceivedTime@Raw("</DeliveryTime>")
@Raw("<ReceivedBy>")@Model.ReceivedBy@Raw("</ReceivedBy>")
@Raw("<ConsignmentNumber>")@Model.ConsignmentNumber@Raw("</ConsignmentNumber>")
@Raw("</Delivery>")
}
Within the "{}" brackets if you would like to output text is must be done using a @Raw() command. An example follows;
<root>
<DeliveryList>
@foreach(var pod in Model.PodData){
@Raw("<Delivery>")
@Raw("<DeliveryTime>")@Model.ReceivedTime@Raw("</DeliveryTime>")
@Raw("<ReceivedBy>")@Model.ReceivedBy@Raw("</ReceivedBy>")
@Raw("<ConsignmentNumber>")@Model.ConsignmentNumber@Raw("</ConsignmentNumber>")
@Raw("</Delivery>")
}
</DeliveryList>
</root>
This would output
<root>
<DeliveryList>
<Delivery>
<DeliveryTime>30/05/2016 11:53 AM AEST</DeliveryTime>
<ReceivedBy>David</ReceivedBy>
<ConsignmentNumber>DEM90241</ConsignmentNumber>
</Delivery>
</DeliveryList>
</root>
Click the button to check and preview.
Click the button to save your changes.
CSV and Text when used enables you to send both CSV/Excel and XML/Json/Text/Other files when configured.
Configure CSV/Excel as above
Configure XML/Json/Text/Other as above
Select the Combined Basic and Advanced Files and click Update