My Main SharePoint List has items with renewal dates and departments. I'm using string variables to pull emails from a Contacts List. I'm trying to get string variables to be linked to the correct email address(es).
Here's how my flow works:
- First some string variables are initialized
- A filter gets items from the Main List to look at items that have renewal dates that are today
- A filter is pointed at the Contacts List to get contacts with the same department name as the Main List
- Some conditions are made to look at contacts with the correct role and no renewal date
- Variables are appended
- Test email is sent


I'm having trouble linking the string variables to the department. An early trigger is if the main list has an item that has a renewal date that's today. Eventually, this flow will automatically recur once a day to look at the renewal dates. If the flow only finds one item, the test email gets sent perfectly. However, if the flows finds two items, the first email has the correct emails, but the second email has the string emails from item #1 and item #2 combined together.
I want the email to be sent so that the string variables are only included in the email if they are linked to the correct department from the Main List (no matter how many items are found under the initial filter for the Main List).
Thanks for your help