Getting an email digest - Looping issue

Options

I have a situation where each time my Power Automate flow finds a record it emails me the record, plus any previous records. Email 1 has 1 row, Email 2 has rows 1+2, .... Email 10 has rows 1 through 10.). How can I place the steps in my flow to send the email outside of the loop? I'm going to post several pictures here:

3fd1e6efac1bb247b862b7c7053b8053-huge-im

And under the If Yes:

36998799190eebf54e1cd3e9b69b874c-huge-im

Thank you.

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Chris Zello
    the problem is in your append to array variable, which you then use it to create a HTML table that you attach to your email.

    your array starts out empty, the first time condition = true and go down yes path, you add the opportunity record (assuming ID=1) to the array and create that as a table to send the email.

    2nd time condition = true, you append the opportunity record into the same array again (assuming id=5), and that array now has ID=1 and ID=5 in it, and create HTML table will create a table of ID=1 and ID=5 (2 rows of data), so on and so forth.

    so question is, is your intention to get 1 email per “blank likelihood”? or 1 email for all blank likelihood found?

    My assumption is the latter, where you only want to get 1 email, if that's the case, then your create html table and email action should NOT be inside the apply to each. After your apply to each, then have a “condition” action to check if your array variable length is greater than 0, meaning there is blank likelihood error. then you create html table in the true path and send email 1x.

  • @Alex Wong Unfortunately when I try making a change to what I think you're saying, it still doesn't work. I've been in touch with Heather to look it over with the next Power Automate User Group meeting. Rather than simply do this with messages here.

    Trust me, once we get it, I'll share the final Power Automate flow.

  • @Chris Zello - We are going to continue workshopping this on Tuesday, right?

  • @Heather McLean Correct! Looking forward to working next week.

Categories