How can I export the "Damaged" inventory quantity from Shopify?

To export the total across all locations, you use the formula below in the Calculated Fields:

get_total([i.quantity for i in load_json_data(flatten_list(get_attribute_value({{ variants.inventory_levels }}, "quantities", recursive=False, return_raw_results=True))) if i.name == "damaged"])

To only export the quantity for a specific location, you use the formula below (replace "Warehouse A" with your location name):

search_attributes(search_attributes({{ variants.inventory_levels }}, "Warehouse A", search_key="location_name", result_key="quantities"), "damaged", search_key="name", result_key="quantity")

Related Articles:


App: EZ Exporter

Tags: shopify inventory export