Hi @Greg DV
Good question.
Try using the Looping app: https://zapier.com/apps/looping/help
Hi
Thanks for your quick reply!
I was able to loop only on the number of items in the array but not on their actual value.
For example if I have the following a line items for 2 products being
[Product 1, Product 2]
[Quantity = 1, Quantity = 2]
I am able to loop twice (as I have 2 products) but I didn’t figure out how to loop 3 times as I would like the result to be:
[Product 1, Quantity = 1]
[Product 2, Quantity = 1]
[Product 2, Quantity = 1]
But I think I figured sth out with the following Zap
The code to create single product orders being
const URL = inputData.File_URL.split(","); const filtered_URL = URL.filter(url => url.includes('pdf')); const Quantity = inputData.File_Quantity.split(",") ; const Id = inputData.Product_Id.split(","); const final_URL = []; const Product_Id = []; let k = 0 for (let i = 0; i < Quantity.length; i++) { for (let j = 0; j < Quantity[i]; j++) { final_URL[k] = filtered_URL[i]; Product_Id[k] = Id[i]; k = k+1; } } output = [{final_URL,Product_Id}];