Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Email String Variables Combining in Test Email

(0) ShareShare
ReportReport
Posted on by

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

 

 

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

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

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Email String Variables Combining in Test Email

    Not Renwal, whatever field starts with Remove.  The one you are testing against Null in your condition.

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

    @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. 

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Email String Variables Combining in Test Email

     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.

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

    Capture 6.PNGCapture 7.PNG

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Email String Variables Combining in Test Email

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

    @Pstork1 

     

    Also here is (hopefully) a better set of screenshots

     

    Capture 3.PNGCapture 4.PNGCapture 5.PNG

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

    @Pstork1 

  • Community Power Platform Member Profile Picture
    on at
    Re: Email String Variables Combining in Test Email

    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

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Email String Variables Combining in Test Email

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1