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 change colors i...
Power Apps
Answered

How to change colors in text with a hybrid html and powerapps command.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there, 

 

I have been racking my brain and looking everywhere to figure this one out. 

How can i make it so the second part of this code the enrolment type is a different color to the first html part. 

There is a drop down "EnrolmentType which will show either Mandatory or Optional I want the Mandatory to show up as red to stand out.  and the optional to be the same white as the bolded html text. I've attached an image of the text as it looks now.

 

"<b><font color=White>Enrolment Type:</font></b> " & GanttTasks.Selected.EnrolmentType

 

Thanks,

Phil

Help1.PNG
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    Hi @Anonymous ,

    Try this

    "<b><font color=White>Enrolment Type: </font></b><font color=red>" & GanttTasks.Selected.EnrolmentType & "</font>"

     

     

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That works to make it red but how do I make it flick between the colors based on the word.

    Optional white 

    Mandatory Red

    See attached.

    Help2.PNG
  • Verified answer
    WarrenBelz Profile Picture
    154,797 Most Valuable Professional on at

    Hi @Anonymous ,

    Something like this

    With(
     {
     wType:
     If(
     anttTasks.Selected.EnrolmentType = "Optional",
     "white",
     "red"
     )
     },
     "<b><font color=White>Enrolment Type: </font></b><font color=" & wType & ">" & GanttTasks.Selected.EnrolmentType & "</font>"
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Warren, I owe you a beer!! thank you.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard