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 / 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

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

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,051 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
    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.

  • Verified answer
    WarrenBelz Profile Picture
    153,051 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
    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

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard