Skip to main content
Question

Can I use a field in an html tag?

  • May 27, 2016
  • 0 replies
  • 57 views

I tried this formula in a text formula field, but the background color does not change when I use the text field called Calendar Color in the html tag. I don't get any syntax errors, but the background color doesn't change.  In this example, the Calendar Color field has a value of #0040ff.

"<div style=\"color:white;background-color:[Calendar Color];\"> " &[Calendar Color]& "<div>"

Please let me know if I'm missing something to use a field in an html tag, or if that's just not possible.
This topic has been closed for replies.

  • Registered
  • May 29, 2016
You were really close - you just needed to put quotes and "&" before and after [Calendar Color], so that the value in the [Calendar Color] field gets filled in.  If [Calendar Color] is inside the quotes, then the string "[Calendar Color]" gets displayed, which is not a valid background-color.

Here's the updated formula:

"<div style=\"color:white;background-color:" & [Calendar Color] & ";\"> " &[Calendar Color]& "<div>

  • Author
  • Registered
  • May 31, 2016
Thanks a lot!

  • Registered
  • May 31, 2016
You're welcome!