cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Leonalx
Frequent Visitor

Change color of a called variable

Hi everyone,

 

I am trying to show a variable in a different color. I am not sure how to explain other than copy the code:

 

I create a Label with the following code:

" TEXT " &Upper(varRecord.Title) & " TEXT"

 

The var recall a field in a SharePoint list and it is working well. I can see the record, it is upper case and it just works. I would like to have his color RED but I am not sure about how to do that.


Any help?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Leonalx 

You cannot alter the color of text within a label.  If you change the Color property of the label, it will change the color for all the text.

Consider using an HtmlText control and set the HtmlText property to:

   " TEXT <font color=red>" &Upper(varRecord.Title) & "</font> TEXT"

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
GarethPrisk
Resident Rockstar
Resident Rockstar

For your Label control:

  1. What property has the code: " TEXT " &Upper(varRecord.Title) & " TEXT"
    1. Is this the Text property of the label?
  2. What is varRecord?
    1. It looks like it may be a record, in a global variable
    2. How is that variable being set?
    3. What do you expected in the Title field?
  3. What color are you trying to set?
    1. The Color property (the color of the text itself)
    2. The Fill property (the background of the control area)
    3. Another Color?
  4. You mention a variable
    1. Should this be dynamic to the value of varRecord.Title?
    2. What is the logic?
RandyHayes
Super User
Super User

@Leonalx 

You cannot alter the color of text within a label.  If you change the Color property of the label, it will change the color for all the text.

Consider using an HtmlText control and set the HtmlText property to:

   " TEXT <font color=red>" &Upper(varRecord.Title) & "</font> TEXT"

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

For your Label control:

  1. What property has the code: " TEXT " &Upper(varRecord.Title) & " TEXT"
    1. Is this the Text property of the label? Yes, It is.
  2. What is varRecord?
    1. It looks like it may be a record, in a global variable. It looks for a record in a SharepointList. 
    2. How is that variable being set?
      Set(varRecord, LookUp(Books, ISBN = Barcode.Value)
    3. What do you expected in the Title field? Give me the title of a book associate in the sharepoint list with the ISBN number
  3. What color are you trying to set?
    1. The Color property (the color of the text itself) 
      The color of the text. No fill or other color) I would like it Red.
    2. The Fill property (the background of the control area)
    3. Another Color?
  4. You mention a variable
    1. Should this be dynamic to the value of varRecord.Title? I think I didn't explain well. The variable that I was talking was varRecord. 
    2. What is the logic? See attached screenshot. The title of the book should be in red. 

It is working, 

 

Thank you!

 

Looks like I have to work extra hard with HTML to have a nice result. 😄

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,848)