im buliding a powerapp that eventually need to send a mail, i used the method suggested in this article in order to produce the formated mail as html and send it.
in my mauil im sending a table with status field i want the status to have diffrent background collor according to the value: good: green, moderate: yellow, bad: red.
i tried diffrnet combinations of the below formula but didnt manage,any ideas what would be the syntax for that?
<td width=104 colspan=2 valign=top style='width:78.0pt;border-top:none;border-left:none;border-bottom:solid;background ="""&If(Status="Good","#00B050", If(Status="Moderate"," yellow", If(Status="Bad"," red ")&""">" windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>"& Status.Value &"<o:p></o:p></p></td>
Please consider changing your Formula to the following:
<td width=104 colspan=2 valign=top style='width:78.0pt;border-top:none;border-left:none;border-bottom:solid;background:" & Switch(Status.Value, "Good", "#00B050", "Moderate", "yellow", "Bad", "red") & ";border-right:solid;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal>" & Status.Value & "<o:p></o:p></p></td>
I hope this is helpful for you.
@RandyHayes , thanks, it solved my issue, it work now perfectly!!!
have one more question, for some reson the html code add few empty rows at the bottom of the table, have any idea why? should i open a new issue for this one?
How are you building your rows? The Html you sent before only dealt with the specific section with the color.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!