cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Email String Variables Combining in Test Email

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

 

Capture.PNGCapture 2.PNG

 

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

 

 

10 REPLIES 10
Pstork1
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

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

Anonymous
Not applicable

Anonymous
Not applicable

@Pstork1 

 

Also here is (hopefully) a better set of screenshots

 

Capture 3.PNGCapture 4.PNGCapture 5.PNG

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

Capture 6.PNGCapture 7.PNG

 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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Anonymous
Not applicable

@Pstork1 

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
slfollosco
Frequent Visitor

Hello! were you able to solve this? I believe I have the same problem

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,467)