cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
flowslcaplikas
Helper II
Helper II

How to fill row color of HTML table using criteria and SendEmailV2

How to fill row color with criteria which is sent via Office365Outlook.SendEmailV2 HTML table?

Current Output:

Selected Item

Item

Item Group

Item ID

Item loaded

Item Load original

Item loaded check

Date and Time

Creator

171

171

GRP

1

true

true

true

2099-99-99 10:15:44

NA

171

915

GRP

2

true

false

false

2099-99-99 10:15:44

NA

171

171

GRP

3

true

true

true

2099-99-99 10:15:44

NA

171

171

GRP

4

true

true

true

2099-99-99 10:15:44

NA

171

915

GRP

5

true

false

false

2099-99-99 10:15:44

NA

171

171

GRP

6

false

true

false

 

NA

171

171

GRP

7

false

true

false

 

NA

 

Wanted output:

If Item_loaded = true and item_loaded_check = false, then red.

if Item_loaded = false and item_loaded_check = false then yellow.

 

Selected Item

Item

Item Group

Item ID

Item loaded

Item Load original

Item loaded check

Date and Time

Creator

171

171

GRP

1

true

true

true

2099-99-99 10:15:44

NA

171

915

GRP

2

true

false

false

2099-99-99 10:15:44

NA

171

171

GRP

3

true

true

true

2099-99-99 10:15:44

NA

171

171

GRP

4

true

true

true

2099-99-99 10:15:44

NA

171

915

GRP

5

true

false

false

2099-99-99 10:15:44

NA

171

171

GRP

6

false

true

false

 

NA

171

171

GRP

7

false

true

false

 

NA

 

Current Code:

 

Office365Outlook.SendEmailV2(
     "Name.name@name.nt",
     "CheckList",
     "<h3></h3>" &
     "<strong></strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>Selected Item</th>
      <th>Item</th>
      <th>Item Group</th>
      <th>Item ID</th>
      <th>Item Loaded</th>
      <th>Item Load Original</th>
      <th>Item Loaded Check</th>
      <th>Date and Time</th>
      <th>Creator</th>
     </tr>
     <tr>" &
    Concat(colExternalLoading,
       "<td>" & varselecteditemid& " </td>
        <td>" & item & " </td>
        <td>" & itemgroup & " </td>
        <td>" & itemid& " </td>
        <td>" & loaded & " </td>
        <td>" & loaded_original & " </td>
        <td>" & load_check & " </td>
        <td>" & Text(date_loaded, "yyyy-mm-dd hh:mm:ss") & " </td>
        <td>" & User().FullName & " </td>","</tr><tr>"
        
        )
                 &
    "</table>",
    {
     IsHtml:true
    }
));

 

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

Hey @flowslcaplikas 

 

We can format the row conditionally during your Concat action, like this: (EDIT, removed the last <tr> as was duplicated during concat)

 

 

Office365Outlook.SendEmailV2(
     "Name.name@name.nt",
     "CheckList",
     "<h3></h3>" &
     "<strong></strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>Selected Item</th>
      <th>Item</th>
      <th>Item Group</th>
      <th>Item ID</th>
      <th>Item Loaded</th>
      <th>Item Load Original</th>
      <th>Item Loaded Check</th>
      <th>Date and Time</th>
      <th>Creator</th>
     </tr>" &
    Concat(colExternalLoading,
       "<tr " & If(loaded && !load_check, 
                   "style='color: red;'>",
                   !loaded && !load_check,
                   "style='color: orange;'>",
                   ">"
                 )
        & "<td>" & varselecteditemid& " </td>
        <td>" & item & " </td>
        <td>" & itemgroup & " </td>
        <td>" & itemid& " </td>
        <td>" & loaded & " </td>
        <td>" & loaded_original & " </td>
        <td>" & load_check & " </td>
        <td>" & Text(date_loaded, "yyyy-mm-dd hh:mm:ss") & " </td>
        <td>" & User().FullName & " </td>","</tr>"
        
        )
                 &
    "</table>",
    {
     IsHtml:true
    }
));

 

 

Chers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

1 REPLY 1
iAm_ManCat
Super User
Super User

Hey @flowslcaplikas 

 

We can format the row conditionally during your Concat action, like this: (EDIT, removed the last <tr> as was duplicated during concat)

 

 

Office365Outlook.SendEmailV2(
     "Name.name@name.nt",
     "CheckList",
     "<h3></h3>" &
     "<strong></strong>" &
     "<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
     "<tr style='background-color:#efefef'>
      <th>Selected Item</th>
      <th>Item</th>
      <th>Item Group</th>
      <th>Item ID</th>
      <th>Item Loaded</th>
      <th>Item Load Original</th>
      <th>Item Loaded Check</th>
      <th>Date and Time</th>
      <th>Creator</th>
     </tr>" &
    Concat(colExternalLoading,
       "<tr " & If(loaded && !load_check, 
                   "style='color: red;'>",
                   !loaded && !load_check,
                   "style='color: orange;'>",
                   ">"
                 )
        & "<td>" & varselecteditemid& " </td>
        <td>" & item & " </td>
        <td>" & itemgroup & " </td>
        <td>" & itemid& " </td>
        <td>" & loaded & " </td>
        <td>" & loaded_original & " </td>
        <td>" & load_check & " </td>
        <td>" & Text(date_loaded, "yyyy-mm-dd hh:mm:ss") & " </td>
        <td>" & User().FullName & " </td>","</tr>"
        
        )
                 &
    "</table>",
    {
     IsHtml:true
    }
));

 

 

Chers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,609)