Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

How to skip send email if output from different compose actions are empty

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a flow setup as shown in below screenshots. Its working without any issues.

Its a very simple flow with 3 get items, 3 filter array, 3 compose, 3 create html table actions and then send an email out.

 

In the send email body, ishtml is set to YES and I am using custom html to format the content displayed.

 

as shown in last screenshot, outputs from all three compose actions are included in the email body.

One concern I have is, if all 3 compose outputs are empty, it still sends an empty email with custom html text which is but obvious by the current design I created.

 

Is there a way to skip send email only if all 3 compose outputs are empty, maybe a simple condition statment works? Not sure, please share info, thanks in advance. 

 

P.S: I Only want to execute send an email task if either of the compose ouputs contain value.

flow1.JPGflow2.JPGflow3.JPG

  • Community Power Platform Member Profile Picture
    on at
    Re: How to skip send email if output from different compose actions are empty

    @ScottShearer I am trying to do something like below before send an email action.

    Capture.PNG

    If all 3 outputs are empty then it returns false but when at least one of them is non-empty then also it returns false, how to use this condition here?

    Bassically if all 3 are empty then false should be returned but if alt least one is non-empty then true must be returned in which I can attach send an email action, any thoughts how to make it work?

  • Community Power Platform Member Profile Picture
    on at
    Re: How to skip send email if output from different compose actions are empty
    Thanks Scott, appreciate the help. I am using odata filter query in my get items and filter array is used for a specific reason. I have to use compose to replace the create html table with a table. There will situations where none of the get items would return anything, that is when I want to skip send email action. Can I use condition for compose output something like not equal to empty?

    I am not really concerned about create html action, rather send an email action. Only and only if one of the compose output returns data then email should be sent otherwise skipped.
  • ScottShearer Profile Picture
    25,208 Most Valuable Professional on at
    Re: How to skip send email if output from different compose actions are empty

    @Anonymous :

    I would approach your requirement a little differently. 

    First, I would not use the compose and filter array statements.  Rather, I would use an OData filter on each of the Get Items actions.  That way, only the items you need are returned and there is no need to filter further.

     

    To find out if any records were returned, I create an array form the items returned for the Get Items actions and check the length of each one.  Then, you can use a condition to see if you want to send an email.

     

    The screen shots below demonstrate the concept of creating the array and checking the length.  The variable I declare is an array.

    If you need additonal help, let me know.

     

    RecordsReturned.jpgRecordsReturned1.jpg

     

    If this answers your question, please mark your post as Solved.

    If you like my solution, please give it a Thumbs Up.

     

    Scott

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow