Apply to each runs its child actions for every element in an array. The input should be the collection you intend to process, often the value array from List rows present in a table or Get items. Choosing a neighboring array such as attachments creates a valid loop over the wrong records.
Inside the loop, item refers to the current element. items with the loop's name makes that scope explicit, which helps when loops are nested. A token from outside the loop can repeat the same first record for every iteration. Empty arrays should produce zero child effects. They are not errors and should not create a blank email. The exercises compare the actual messages and their count, so both the loop's input and the current-item reference matter. Duplicate elements stay duplicate unless the business task asks you to deduplicate them.