I'm trying to dynamically get email adresses from a sharepoint to the "To" field in Send email action (positioned below showed apply for each).
Flow:
1. List files in OneDrive folder
2. Condition to check if any filenames contains keywords (DRIP and PVT in this case)
3. If yes - Get file content and append to array for attachment to Send Email, then move those files to a "Sent"-folder.
4. Send email with attachment
This works as intended.
But now I'm trying to dynamically get email adress instead of typing it out in the flow. I created a sharepoint list with several columns, two of them containing different keywords (field_ 3: DRIP, field_2: PVT).
field_1 contains the email adress.
Basically I want the flow to add email adress from sharepoint list matching the same keywords in the files handled in the loop.
If I have the Send Email action outside the loop I cant get the dynamic value from the "Get Items"-filter (which is inside the loop), and if I put the Send Email action INSIDE the loop I can choose the dynamic content from "Get Items" but then the Send Email action gets put into another "Apply for each" and the flow sends multiple emails if attached files are 2 or more.
If it's 3 files it sends 3 emails (email 1 with attachment 1, email 2 with att 1+2, email 3 with att 1+2+3).
Also dont really know the syntax for get items filter to give me the email adress if the keywords are matched.. 😞

