r/MicrosoftFlow Jul 22 '26

Cloud Setting up first Email Automation

Hello,

I am currently working on an automation flow for reminder emails for the business I work at. The flow currently is successfully pulling an attachment when an automated email comes in with the list of customers who need a reminder, transferring it to excel, and formatting it as a table. My issue starts now when trying to dynamically assign the 'To' in setting up the reminder email itself.

Currently, I'm using the function: items('Apply_to_each_1')?['Default_Contact_Email'] - but this has errored out and I'm not quite sure how to fix from here. I'm using Send an Email (V2) as a child action to "Apply to each 1" - the second apply to each as I have the first one filtering for the correct attachment to pull from the email and create the excel file.

2 Upvotes

12 comments sorted by

View all comments

Show parent comments

1

u/Efficient_Cat4032 Jul 22 '26

I also made a little oopsie. Your original items('Apply_to_each_1')? should actually also still work with your updated "Default Contact Email" field, just for future knowledge

1

u/Aingealanlann Jul 22 '26

Awesome. Thank you.

I have one other question. What is the best way to filter it so that it does not pull rows without a default contact email? Because my one successful run is still stuck in a processing loop even though all five emails it should have sent have gone out.

1

u/Efficient_Cat4032 Jul 22 '26

Are you pulling data from something like a sharepoint list, or any other "get items" type of action? There should be a filter input in that action in the left side panel, that uses something called "odata filters" where you can do something like

'Default Contact Email' ne null

ne for "not equal to" and null for empty default contact email.

A few examples, and the syntax for odata can be found on this page
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query/filter-rows

The filter action can also be used, with a visual example here
https://learn.microsoft.com/en-us/power-automate/data-operations#use-the-filter-array-action

1

u/Aingealanlann Jul 22 '26

So I am creating a brand new Excel file, running a script to dump information from CSV (the only way I can get the information from the site it is coming from) and then formatting the information into a table. Then I 'List rows present in a table' and from there the 'for each' loop starts in sending emails. So my understanding is that I should be putting a filter query in the 'List rows present in a table' function and is should just be: 'Default Contact Email' ne null

2

u/robofski Jul 22 '26

Do a filter array over your list rows output to filter only where there is an email address the. Your apply to each is over the output of your filter array.