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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / html cell background-c...
Power Apps
Unanswered

html cell background-color

(0) ShareShare
ReportReport
Posted on by 402

Hi there,

 

i have a collection, and i want to send a email in an html format.

i want furthermore display cell's color depending on the status value.

i mess to achieve that last point, and i don't know if it's possible in Powerapps or if i have to do it in power automate

 

The basic html code is the following

<td style=""background-color:red;"">" & Statut & " </td>

 

i tried something like that, but without succes

If(Ldlv_Rapport.Statut in "HS";
 <td style=""background-color:red;"">" & Statut & " </td>);
 Ldlv_Rapport.Statut in "HS après intervention";
 <td style=""background-color:Orange;"">" & Statut & " </td>);
 white)

i want to have something like that

 

GeekAlf_Pro_0-1653294725591.png

 

Thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @GeekAlf_Pro ,

    Following the logic you posted, try this

    "<td bgcolor =" & 
    If(
     Ldlv_Rapport.Statut in "HS";
     "#FF0000";
     Ldlv_Rapport.Statut in "HS après intervention";
     "#FFA500";
     "#FFFFFF"
    ) & ">" & Statut & " </td>"

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • GeekAlf_Pro Profile Picture
    402 on at

    Hello @WarrenBelz 

     

    thanks for taking time to answer.

    unfortunatly, i have this message

    GeekAlf_Pro_0-1653296047293.png

    it says  "impossible to use Table in this context"

     

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @GeekAlf_Pro ,

    I cannot test this presently, but what happens when you do this

    "<td bgcolor = #FF0000">" & Statut & "</td>)"
  • GeekAlf_Pro Profile Picture
    402 on at

    with your code slightly modified, all the column is red

     

    <td bgcolor = #FF0000>" & Statut & "</td>

     

  • GeekAlf_Pro Profile Picture
    402 on at

    i think that it is not the code with the color that's the problem

    but the fact that i can't use the value of the status, hence the message "impossible to use a table in this context"

  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @GeekAlf_Pro ,

    Then the other code should work and display the different colours. Try this, but it is really the same

    With(
     {
     wColour:
     If(
     Ldlv_Rapport.Statut in "HS";
     "#FF0000";
     Ldlv_Rapport.Statut in "HS après intervention";
     "#FFA500";
     "#FFFFFF"
     )
     };
     "<td bgcolor =" & wColour & ">" & Statut & " </td>"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • GeekAlf_Pro Profile Picture
    402 on at

    Thanks a lot @WarrenBelz 

     

    the "with" helps me a lot and i replaced the "ldlv_rapport.statut" by "ThisRecord.statut" and it works fine !

     

    here is the final code

    "& With(
     {
     wColour:
     If(
     ThisRecord.Statut in "HS";
     "#FF0000";
     ThisRecord.Statut in "OK après intervention";
     "#FFA500";
     ThisRecord.Statut in "OK";
     "#b0f2b6";
     "#FFFFFF"
     )
     };
     "<td bgcolor =" & wColour & ">" & Statut & " </td>"
    )&"

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard