When an item in the Sharepont list "Users" is created/modified, the flow gets all the items from the list "Emails" and sends the text in each item as separate emails. Item 1 is one email, item 2 is another email, and so on.
Some of the items in "Emails" have attachments, that are sent with the email.
Usually, when working with email attachments in list items, I use an array variable to collect and attach the files. But in this case, this will not work as desired. Since the flow gets several list items at once, the array variable would add attachments to emails that should not have emails. Example: item 1 has one attachmant, and item 2 has no attachment. The loop will collect the attachment from item 1 and also attach it to 2 and the following items.
What is the correct approach to achieve what I want?