Order headers and lines in one CSV


Customize a report with header and line items in one CSV file

If you need one CSV file including

  • header details
  • and line details you can create a csv structure like this using DataChamp:
Line identifierOrder numberDetails
HEADER#01Header details ....
LINE#01Line details ...

Here is a detailed step by step guide how to configure a csv export like this using DataChamp:

  1. Create "New Report" "Orders"

Click on "New Report", than choose "Orders".

  1. Rename the tab from "Orders" to "Order headers"

rename-tab

  1. Choose the fields you want to export from the order header

Choose from Order and other sections - like "Order / Shipping Address":

choose-fields

  1. Next - add a custom column "Line identifier" and drag and drop the column to the first postion

add-line-identifier

  1. Activate "Omit header row"

You will find this option in the tab "Rows":

omit-header-row

  1. Add additional tab "Header lines"

Choose again Export "Order" and name the tab "Order lines":

add-tab

  1. Choose the fields you want to export from the order lines

Remove everything you don't need repeated for every line because you already outputed the information with the header line. And add everything you need from the "Line items".

  1. Add the "Line dentifier" "LINE":

line-identifier

  1. Activate "Omit header row"

As you configured the first tab "Order headers" you now activate "Omit header row" for this second tab "Order lines":

omit-header-rows-2

  1. Choose export mode "Fill"

This option is necessary to get a filled custom column "Line identifier" for each "Order line". Click on "Edit" in the settings area on the right:

fill-mode

  1. Configure the file type to CSV

In the right column you find the settings for file type. Chosse "CSV".

  1. Save and run your report.

Choose from the button at the top right "Save & Run". Take a look at your csv file and do further customizations if necessary. If you run into line limit warnings configure filters for both tabs. E.g. only export recent orders by using the filter "created at".