How can I create a CSV export of my Shopify orders without duplicating certain order-level data like shipping info for each line item row?

By default, EZ Exporter will put each line item in the order in a separate row in the CSV export, duplicating the data at the order level like this:

As you can see, data at the order level such as the shipping information is repeated for each line item in the order.

If your system requires you to have data at the order level blank for each line item row except the first one, you can use a formula like this in the Calculated Fields:

{{ shipping_address.name }} if {{ line_items._index }} == 0 else ""

What the formula above does is basically insert the field value only if the line item index/position is equal to 0 (i.e. the first line item in the order), and use a blank value for the rest.

This formula will change the report to look something like this instead:

Please note also that this will only work if you are not filtering the line items under Custom Filters.  It won't work reliably if you do as the line item row that gets filtered could be the row with the index 0.

On the "Templates" page, there's also a pre-built template that will export the data similar to Shopify's default order CSV export where order-level data is only visible for the first line item row. The template is called "Shopify Default Format (Similar But Not Exact, Last 7 Days Orders)" and you can customize it further as needed.


App: EZ Exporter

Tags: advanced features, shopify orders, order export