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:
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
The list of email addresses needs to be semicolon delimited. Make sure you add a semicolon after the dynamic content that enters the email addresses when you append them to the string variable. The resolution on your screen shot is quite low so I can't tell for sure but it doesn't look like you've added the semicolons.
I tried that, and it didn't fix the problem. Since I pressed "enter" after each dynamic content, the emails already came back as individual emails.
I will try to clarify my problem better.
Let's say that the flow brings back 2 items. Item 1 has department "X" and item 2 has department "Y". The first email contains all the emails pertaining to department X, but the second email contains all the emails from X AND Y. I want the string variables to only be in the email if they fall under their respective department
Sorry, I thought you were using the emails addresses to address an email to some group of users. But as I said its hard to read the screenprints as small as they are.
Can you upload screenprints that focus on the condition and then the actions that update each variable? If I can see more detail I'll try to help. It sounds like its an issue with the logic.
I suspect the problem is the logic around the renewal date being Null. The problem is that when you do a get in Flow if the field is null it isn't returned in the JSON. So you can't test against it for that item because it doesn't exist. That's different from it existing but the value being null. Check a previous run and look at the values returned. Verify that the renewal date actually exists for all the items you are checking.
The first Get Items (for the Main List) has a filter that's looking at the renewal date -- and that renewal date column on the SharePoint List is a required value, so I don't think that's the problem. I'm always getting an item. And in the email I'm able to look at the dynamic content and verify the title/ department.
I'm new with variables, so I was thinking it had something to do with splitting the variable, using an array, making an increment variable -- or something like that. I just wasn't sure which one I should utilize.
Not Renwal, whatever field starts with Remove. The one you are testing against Null in your condition.