Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
We want to loop through all recently fulfilled orders each hour and assess whether any orders have the tag 'delivery failed' applied. If this tag is present, we want to trigger a customer email in Klaviyo.
Additional info 1: the 'delivery failed' tag is automatically added to the order by our shipping app (DPD integration app) and since there's no "added tag to Order" trigger in Shopify Flow, we need to periodically go loop through the orders to check.
Additional info 2: the 'delivery failed' information should also be saved somewhere else in the order data (e.g. in custom order attribute?) as it is visible in the interface (see below image as example) however we are not sure how to access it. Therefore, we are working based on order tags.
We tested the below Flow, using the 'Scheduled Time' trigger and a 'For Each' loop. The aim is to list all unfulfilled orders that were created in the last month which we then can iterate over using the 'For Each'. However, we can't get the condition in the For Each loop to check each individual order seperately: it only checks whether the 'delivery failed' tag is present in any of the listed orders, not just the individual order that we are iterating over. Therefore. the final action ('send data to Klaviyo') is performed on all the orders, not only the ones with the tag.
Any help is greatly appreciated!
Solved! Go to the solution
This is an accepted solution.
So first, in the query you can filter by `tag:"delivery failed"`. Then you don't need that condition at all. i suspect your condition is ill-formed but cannot tell from the overview (provide a screenshot of that if you need further trouble-shooting). In the condition, if you keep it, you need to use the "item" that is returned from the for-each loop.
Maybe try the "WHERE" filter in Liquid which will allow to sort things by date and only select the date range needed. It will need a valid date range from input data too.
https://shopify.dev/docs/api/liquid/filters/array-filters#where
Talk your feedback, please,
François,
Digico Paris
If you can't find a solution with Shopify Flow, as a backup plan you could use Order Automator app. It's an automation app for order processing tasks, but is also extendable with custom features to do stuff like what you're asking.
This is an accepted solution.
So first, in the query you can filter by `tag:"delivery failed"`. Then you don't need that condition at all. i suspect your condition is ill-formed but cannot tell from the overview (provide a screenshot of that if you need further trouble-shooting). In the condition, if you keep it, you need to use the "item" that is returned from the for-each loop.
Many thanks, that worked. The option to query on tags is very useful, somehow I missed this in the docs
Thats is done in this case, but I have the same problem as well.
I need to delete items from my store if it is older than 18 months skip the product that have all variant inventory equal to 0.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024