Fairly new to Logic Apps and not familiar with all the functions. I created a simple Logic App that will check Backup of VMs on Azure and produce the report in formatted fashion.
I am getting what I want but there is requirement of cosmetic change where I want to get Colum Name "JobFailureCode" if Success background color should be Green or Failed with Red. can you please some one guide me what and how to achieve this? and Out put I am receiving in mail
For testing purpose, I am using static values in a variable and then adding the HTML template data in Compose, you can also use Create HTML table action.
I am using below HTML template in Compose action to set the background color to either green or red. You can modify the template based on your requirement before invoking the send email action.
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>JobFailureCode</th>
</tr>
</thead>
<tbody>
<tr>
<td>@{items('For_each')['Name']}</td>
<td style="background-color:@{if(equals(items('For_each')['JobFailureCode'], 'Success'), 'green', 'red')}">
@{items('For_each')['JobFailureCode']}
</td>
</tr>
</tbody>
</table>
If JobFailureCode is Success.
If JobFailureCode is Failed.