web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Email empty fields

(0) ShareShare
ReportReport
Posted on by 5

Hi

 

I'm new to using PA and I've stumbled into a problem that i suspect has a more elegant solution that the flow that I'm using now. 

I'm using a flow to send email for each row in an Excel-sheet. The sheet contains some data and 1-3 adresses. The problem is that some of the email-fields are empty. So now the flow null-checks every email-feild via a condition. It works as intended, but I have to copy-paste the send email-action three times, wich is both annoying and a pontential source for errors. I'm changing the email text quite often. 

Is there a better solution? Preferrably one that just uses one send email-action. 

Thx in advance! 

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at
    Re: Email empty fields

    There might be an easier way than how I generally do this sort of thing, but it works.

     

    I initially concatenate (concat) each of the emails and add a semi-colon between each one, then enclose this into a split expression on semi-colon. This gives me an array of emails (both filled in and blank).

     

    The expression for this example might look like this:

     

    split(concat(item()?['Email 1'], ';', item()?['Email 2'], ';', item()?['Email 3']), ';')

     

    grantjenkins_5-1665925088589.png

    grantjenkins_0-1665924752181.png

     

    I then filter our any empty items in the array using a Filter Array resulting in the following. 

    grantjenkins_4-1665925045179.png

    grantjenkins_1-1665924796402.png

     

    Finally, I use another Compose to get me a list of email addresses separated by a semi-colon.

     

    The expression for this example might look like this:

     

    join(body('Filter_array'), ';')

     

     grantjenkins_6-1665925126637.png

    grantjenkins_2-1665924873914.png

     

    See full example flow below that sends an email to all the emails listed in each row.

    grantjenkins_3-1665924942270.png

     

  • Kristian3 Profile Picture
    5 on at
    Re: Email empty fields

    Works great, thx! The main issue was the multiple email actions and your flow solved that.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard