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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
GarethPrisk
Super User II
Super User II

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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (45,550)