Hi guys,
I’m looking for a solution using a loop while looking for specific value and storing those value in an items list and keeping the order.
My zap goal is to so send new order in Shopify to a billing software called Evoliz.
So here are my zap steps
- Catch a new order from shopify
- Check if the customer exist in evoliz, if it doesn't it create it.
- I'm counting the number of products in my order.
- I'm starting my loop for each product present in my order
- For each product from the shopify order, I'm checking if this product exists in evoliz, if not I create it. For each product I will get an ID.
- This is where I'm stuck, I need to create a list (an array) of the different ID I get from step 5
- I use a filter to "stop" my loop once I reached the last product of the order.
- In this last step I create my invoice. This were I will use the item list I created earlier.
I need to send the ID of the products in an items list so something like that ID1,ID2,ID3 …. I manage to do that using Formatter, line Itemizer.
My problem is how the loop works.
When I launch my zap, zappier will start the first iteration of the loop. Then it will start all the other iteration of the loop in parallel.
In step 5 I’m looking for the article in Evoliz, if it’s not already in Evoliz Zap will create the article in Evoliz, and the will be longer than just looking up for the article.
So If I have 3 products in my order from shopify let’s say Product1, Product 2 and Product3.
Product 1 and 3 already exists in Evoliz but not Product 2.
If I launch my zap, step 5 for Product 2 will be longer than the same step from Product 3.
And in the end my line of item will look like this:
ID Product1, ID Product 3, ID Product 2
while I need to get:
ID Product1, ID Product 2, ID Product 3.
I thought about introducing a delay to prevent that but I’m note convinced this is the best solution since I don’t know how many product will be in my order.
Any idea how to deal with that?