Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi, we are looking to find a way to automatically add all products that have been ordered in the last 48 hours to a collection, and then come out again after 7 days.
I tried using a scheduled workflow and getting order data, however it won't let me get the product data in the same workflow to add them to the collection.
I tried also to use Order Created as a trigger, but again can't seem to get the product data from the order to add to the collection.
Any suggestions, please?
Hello @QueenOfFashion
I think the easiest way to do it is to create a cronjob using a custom app and then it runs on every 48 hours intervals.
Let me know if you need any help from my end.
Hi
Apologies for my ignorance but what do you mean by 'cronjob' and which custom app?
Ideally I am looking for ways to do this on Flow.
Many thanks,
Sue
The requirement you have cannot be achieved by the Flow app. You need a custom solution where a cron job (a function of code that runs in set interval) will run every 7 days to fetch the order data and update the given collection.
I have done similar thing for a client. Let's connect so I can explain you better.
@QueenOfFashion
So probably the way to do this would be:
The metafield is needed because otherwise you won't know when a product has been ordered, and the same product could be ordered more than once in that time window.
You might be able to do this with schedules as well, but I think that logic for that is much more complicated.
Thanks Paul however when going straight from order created to adding products, an error flags to say there is a get data step missing.
I had a lot of issues adding multiple actions when having that data step there.
I thought I had cracked it as follows:
Order Created - Get Product Data - For Each - Add to Collection
It says it has worked successfully but nothing added to the collection.
Frustrating!!
You don't need "Get product data" but you do need the For each loop. Basically, you would loop over the order / lineItems right after the trigger.
The reason you get 0 results is you likely didn't have the right query set up for "Get product data"
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey 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, 2024