How do I export only the Shopify orders with new returns since the last export?

You can configure the filters as shown below to only export Shopify orders where a new return was created since the last export:

The first setting is to set Filters > Created to some reasonable date range to reduce the amount of data to request from Shopify and speed up the export process. For example, if your return policy is 60 days, then setting this filter to "Last 90 Days" would be sufficient.

Then we want to also use the following Custom Filters:

Data must match: all conditions

  • Last Return Date is greater than or equal to {{ last_successful_run }}
  • Last Return Date is less than {{ current_task_start_time }}

The Custom Filters are applied on our end and our app will then filter the data further to only include orders where the last return date is greater than or equal to the last successful run date.

The second Custom Filter handles potential race conditions where a new return is created while the export process is still running, so it's important to include that as well to prevent duplicates where an order might get included both in the current run and also the next run.

Note that this filter is at the order level.  If you want to filter at the line item level instead and only include the specific line items in the order that were returned, simply use the field "Lineitem Last Return Date" in the Custom Filters.


Related Articles:


App: EZ Exporter

Tags: advanced features, shopify orders, shopify returns