Hi- I am looking for some assistance splitting quantities in my flow in order to create individual emails for activation of digital products I sell. My Ebay customers often place orders that contain multiples of the same SKU or multiple items that are different SKUs. I need to be able to order the digital products from my third party individually and then send an individual email to the end customer for each product purchased. I have iterators in my flow on orderid, line item, SKU and qty, but the flow one sends the email on the first sku and even if the qty is 2 on that SKU, only 1 order is generated. Any suggestions are greatly appreciated. thank you.
Hello @zippyeSIM. Welcome to the community.
It all depends on the format you have before the iterator and what you are passing through. From what you are saying, you are probably not iterating the desired array properly.
Could you share some screenshots of the scenario setup and the values you are iterating, so we can have a better understanding of the problem?
What is the format of the data you have? (For example what does the orderid, line item and SKU have to do with each other)
make flow steps.docx (930.0 KB)
formats are coming from the ebay watch for orders module. On a set cadence, I am pulling in new orders.
You checked this one as solved. Did you figure it out or was it by mistake?
If not, I am not really familiar with the ebay module. Can you share the data format the module outputs?
You can get it by hitting the spying glass and then the “download output bundle” on the module you want (in our case the ebay module).
mistake, sorry. not solved. I did the output of the module (attached). I did redact all the buyer information but not part of this solution request
Watch for orders output bundle.docx (18.7 KB)
OK so from what I see the different quantities of items reside inside the “LineItems” variable.
Since you said there are 2 possible cases, a customer ordering muptiple different SKUs and a customer ordering multiple units for the same SKU :
-
If there is an order for different items, you should probably have different LineItems here with different SKUs. So iterating the “LineItems” and then adding a module for an email or anything else you need, should work for this case.
-
If you have more quantities of the same item (so everything is the same but “quantity” is more than “1”) you can use a repeater module with the “quantities” mapped on the “repeats” field. After the repeater you add the modules for the emails etc and it happens as many times as the quantity. (this will not cause problems when you only have 1 quantity as well.)
Is this what you are looking for?
So, instead of iterator on qty, I replace with repeater? Do I still need array aggregator and iterate module after it for qty? Just trying to understand modules and their order for the workflow. I am a novice for sure. Thanks!
In short yes. There is nothing to iterate through in the “quantity”. Only a single value in a form of a number. You only have 1 quantity variable no matter how big the number is.
There are no repetitions on the data format that will allow you to send emails multiple times, so you have to create some yourself.
By adding that parameter inside a repeater you make sure that whatever action happens afterwards (sending email or verifying an order or whatever), happens as many times as the quantity.
As an example, the structure should be like this
- you pass the “quantity” in the “repeats” field of the repeater
- you do whatever actions you need (emails etc)
You DO NOT want to use an aggregator as this will stop whatever happens after the aggregator from happening multiple times. The aggregator gathers data from multiple repetitions and puts them all together in 1 bundle. (before the aggregator the actions repeat, after the aggregator the actions happen once)
That makes sense. So, I removed the array aggregator and replaced with a repeater module followed by a set variable module on qty. I also hardcoded “1” on the order esim module since I need the number ordered to always be one, with one email sent afterward per each qty. I am assuming that is what your proposed solution is. If I missed something, please let me know.
Almost, yes.
The “Set Variable” was just an example to show that any action you have goes after the repeater. There is no need to for you to use one.
What you need to put after the Repeater is the modules you have below.
Hard coding a value of “1” makes sense indeed.
Now I am tracking with you. So, I removed the set variable action from the flow and on the repeater, I set “initial value” to one because that is the minimum qty that occurs and then mapped the “repeats” to the qty variable. Then, proceeded with the ordering, email, etc. Thanks for your help!