powerapps

Have 2 sets of colors used within a Title Formula


I have a string used in my header forumla:

 Title = "My title is " & titleName

I want the first part to be blue, that's in quotes and the variable to be black. I tried doing something like this:

 titleName = ColorValue(Black, title.Text);

but that threw errors.


Solution

  • You can use html & css to format your string, something like this:

    Title = "<span style='color:Blue'>My title is </span> <span style='color:Black'>" & titleName & "</span>"
    

    Then put this variable in the HTMLText property of an HTML text control element. See the following MS documentation: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-html-text

    You can use the following reference https://www.w3schools.com/tags/ref_colornames.asp to choose the desired colors.