Hi,
This is how you can do that
Step 1. Get your Items from SharePoint
Step 2. Use a Select action, to create an Array of Just serial numbers. These are NOT unique yet
Step 3. Use a Compose to do a Union of the Output from the Select action like this
union(outputs('Select_all_serial_nubmers'),outputs('Select_all_serial_nubmers'))
This will give you an array of UNIQUE Serial Numbers (pretends its your PO numbers)
Step 4. Use an Apply to Each to loop through all the unique SN's (aka pos)
Step 5. Use a Filter Action: for each Serial Number, now you want to filter the list you got from Get Items, where Get Items Serial Number = The Value from the Loop which is the unique serial numbers
Step 5. Now you can loop through the Filter Action output and now you only have the values from SN 1, then 2 then 3 etc.
now an important thing is BEFORE you loop on the Filter, you would do your sheet create (if it doesn't exist etc).
And in the loop is wherd you do your Add Row to a table in excel.
Step 6. AFTER the Step 5 loop, is where you send your email. In this step you are STILL in the Unique SN (PO) loop but you are out of the Filtered Action loop.
You would have created whatever you wanted to build up, to send in the Filtered Action and then send the email to the correct people for that SN(/PO)
