How do I export the name of the "Automatic Discount" that was applied to the Shopify order?

"Automatic Dicounts" data (which is different from "Discount Codes") is stored in the field discount_applications.

The raw API data will look something like this:

[
    {
        "allocation_method": "across",
        "target_selection": "entitled",
        "target_type": "line_item",
        "title": "BFCM DEAL 50",
        "type": "automatic",
        "value": "50.0",
        "value_type": "percentage"
    }
]

To export just the title of the Automatic Discount that was applied to the Shopify order with EZ Exporter, you can use this formula in the Calculated Fields:

search_attributes({{ discount_applications }}, "automatic", search_key="type", result_key="title")

The formula will search the list of application discounts for items where the type is "automatic" and return the value of the "title" attribute.


Related Articles:


App: EZ Exporter

Tags: advanced features, discounts, shopify orders, calculated fields