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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to separate one ta...
Power Apps
Answered

How to separate one table into two in email

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all, i'm stuck and hope you'll help me

 

I need PowerApp to separate one table into two in email based on column "Quality Status" - please see example of source table below (table and PowerApp code will be attached in excel).

Oseme_0-1600267509834.png

I can send single table via mail using this logic:

Oseme_1-1600267547831.png

It works well and sends following message:

Oseme_2-1600267637953.png

 

What i'm trying to achieve is to filter output message based on field "Quality Status"

There are 3 possible scenarios:

1) Column "Quality Status" has both attributes - "Overdue" and "Check"(see example below) 

Oseme_3-1600267743064.png

Then output should look like this

Oseme_4-1600267790109.png

 

 

2) Column "Quality Status" has attribute "Overdue" only(see example below):

Oseme_5-1600267861062.png

Then output message should look like this:

Oseme_6-1600267883872.png

 

 

3) Column "Quality Status" has attribute "Check" only (see example below):

Oseme_7-1600267929010.png

Then output message should look like this:

Oseme_8-1600267959397.png

 

How should i modify PowerApp logic to achieve this?

 

Many thanks in advance!

 

Regards,

Oleh

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @ Oseme:

    My suggestion is to use the if function to divide the body of the email into three situations for processing:

    If(
    ""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage' && ""Check"" in [@PowerBIIntegration].Data.'Age on Stage';
     Code1;
    ""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage' && !(""Check"" in [@PowerBIIntegration].Data.'Age on Stage');
     Code2;
    !(""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage') && ""Check"" in [@PowerBIIntegration].Data.'Age on Stage';
     Code3;
    )

    Finally, the complete formula should be (because of regional issues, the operator we use is different, so I can't test this code, there may be some minor errors):

    Office365Outlook.SendEmail(
     First([@PowerBIIntegration].Data).Email;
     "Revenue Notification";
    If(
    ""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage' && ""Check"" in [@PowerBIIntegration].Data.'Age on Stage';
     ""Hi "" & First([@PowerBIIntegration].Data).Owner&"",""& ""<br>"" &
     
    ""Currently,you have teh following XXXXX"" & ""<br>"" &
     
    ""<table border=1>
    <tr>
    <th>Account</th>
     
    <th>Opportunity</th>
     
    <th>Revenue</th>
    <th>Sales Forecast</th>
     
    <th>Sales Stage</th>
    <th>Age on Stage</th>
    <th>Deal Desk</th>
     
    <th>CustomerAcceptance</th>
    <th>Quality Status</th>
    </tr>"" &
    Concat(
     
     ForAll( Filter([@PowerBIIntegration].Data;""Overdue"" in 'Quality Status');
    ""<tr><td>"" & Account &
    ""</td><td>"" & Opportunity &
    ""</td><td>"" & Revenue &
    ""</td><td>"" & 'Sales Forecast' &
    ""</td><td>"" & 'Sales Stage' &
    ""</td><td>"" & 'Age on Stage' &
    ""</td><td>"" & 'Deal Desk' &
    ""</td><td>"" & CustomerAcceptance &
    ""</td><td>"" & 'Quality Status' &
    ""</tr></td>""
    );
    Value
    ) & ""<br>"" &
     
    ""Also please reviewXXXXXXXXXX"" & ""<br>"" &
     
    ""<table border=1>
    <tr>
    <th>Account</th>
     
    <th>Opportunity</th>
     
    <th>Revenue</th>
    <th>Sales Forecast</th>
     
    <th>Sales Stage</th>
    <th>Age on Stage</th>
    <th>Deal Desk</th>
     
    <th>CustomerAcceptance</th>
    <th>Quality Status</th>
    </tr>"" &
    Concat(
     
     ForAll( Filter([@PowerBIIntegration].Data;""Check"" in 'Quality Status');
    ""<tr><td>"" & Account &
    ""</td><td>"" & Opportunity &
    ""</td><td>"" & Revenue &
    ""</td><td>"" & 'Sales Forecast' &
    ""</td><td>"" & 'Sales Stage' &
    ""</td><td>"" & 'Age on Stage' &
    ""</td><td>"" & 'Deal Desk' &
    ""</td><td>"" & CustomerAcceptance &
    ""</td><td>"" & 'Quality Status' &
    ""</tr></td>""
    );
    Value
    );
    ""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage' && !(""Check"" in [@PowerBIIntegration].Data.'Age on Stage');
    ""Hi "" & First([@PowerBIIntegration].Data).Owner&"",""& ""<br>"" &
     
    ""Currently,you have teh following XXXXX"" & ""<br>"" &
     
    ""<table border=1>
    <tr>
    <th>Account</th>
     
    <th>Opportunity</th>
     
    <th>Revenue</th>
    <th>Sales Forecast</th>
     
    <th>Sales Stage</th>
    <th>Age on Stage</th>
    <th>Deal Desk</th>
     
    <th>CustomerAcceptance</th>
    <th>Quality Status</th>
    </tr>"" &
    Concat(
     
     ForAll( Filter([@PowerBIIntegration].Data;""Overdue"" in 'Quality Status');
    ""<tr><td>"" & Account &
    ""</td><td>"" & Opportunity &
    ""</td><td>"" & Revenue &
    ""</td><td>"" & 'Sales Forecast' &
    ""</td><td>"" & 'Sales Stage' &
    ""</td><td>"" & 'Age on Stage' &
    ""</td><td>"" & 'Deal Desk' &
    ""</td><td>"" & CustomerAcceptance &
    ""</td><td>"" & 'Quality Status' &
    ""</tr></td>""
    );
    Value
    );
    !(""Overdue"" in [@PowerBIIntegration].Data.'Age on Stage') && ""Check"" in [@PowerBIIntegration].Data.'Age on Stage';
    ""Hi "" & First([@PowerBIIntegration].Data).Owner&"",""& ""<br>"" &
     
    ""Please reviewXXXXXXXXXX"" & ""<br>"" &
     
    ""<table border=1>
    <tr>
    <th>Account</th>
     
    <th>Opportunity</th>
     
    <th>Revenue</th>
    <th>Sales Forecast</th>
     
    <th>Sales Stage</th>
    <th>Age on Stage</th>
    <th>Deal Desk</th>
     
    <th>CustomerAcceptance</th>
    <th>Quality Status</th>
    </tr>"" &
    Concat(
     
     ForAll( Filter([@PowerBIIntegration].Data;""Check"" in 'Quality Status');
    ""<tr><td>"" & Account &
    ""</td><td>"" & Opportunity &
    ""</td><td>"" & Revenue &
    ""</td><td>"" & 'Sales Forecast' &
    ""</td><td>"" & 'Sales Stage' &
    ""</td><td>"" & 'Age on Stage' &
    ""</td><td>"" & 'Deal Desk' &
    ""</td><td>"" & CustomerAcceptance &
    ""</td><td>"" & 'Quality Status' &
    ""</tr></td>""
    );
    Value
    );
    );
     {IsHtml: true})

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks - worked perfectly!

     

    Best regards, Oleh

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard