Color Code a Formula
Hello, I would like to color code a formula I have that is subtracting the value from two existing number fields.
In this formula, for example named 'Total Demand' I want it to change color based on the values. When the value is a negative number, I would like for it to be red. If it is a positive number, I would like for it to be yellow, and if it =0, then I would just like it to display a gray color.
Can someone please help me with this?
12 replies
-
Bump
-
Hi, use the styled() element.
if demand > 10 then styled(demand,"green")
else styled(demand,"red")
-
I am getting an error.
Function is not defined: styled(number,string) at line 2, column 32
-
transform to text:
styled(text(demand),"red")
-
Great! Thank you! One last question, how do I specify the exact color code?
-
I figured it out
styled(text(demand),color(000,000,000))
-
Lastly, is there a way to center the text formula, so its not on the left side?
-
Bump
-
as a formula feld:
---
html("<center>" + 'Text Field' + "</center>")
---
Leo
-
Is it possible to combine html() and styled() in the same formula?
-
Also, is it possible to create a formula field that uses styled(), and also opens a record with popupRecord() when it is clicked?
-
The answer to these last two questions is: Unfortunatly no.
Birger
Content aside
- 6 yrs agoLast active
- 12Replies
- 5680Views