Changing color/styles for table values
Im trying to write a beast mode that will change the value to a Bolded colored text when meeting a certain condition. As a test I wanted to try to just get the bold color to apply without condition but for the whole column. I have found Domo articles and forum posts about this but nothing works. To verify this, I added my beast mode to the summary at the top of the table and it DOES work, just not on the columns. Has anyone else experienced this? any guidance?
I also KINDOF managed this by using the Color Rule properties and pushing the transparency of the cell background to 0%. This does allow for colored font weight but for reds and greens, they are so dark that you almost cant tell the difference from black.
Im convinced that there has got to be a way to do this given that it is featured in a Domo article. any help would be welcomed.
Best Answers
-
Yes, I have gotten this to work.
Heads up:
- HTML formatting tags only work on Summary Numbers (which you got to work), HTML tables, and Heatmap tables. (Not MegaTables or Pivot Tables).
- Stuff in your HTML formatting might get "trumped" by other properties native to the card. For example, the font-weight (bold/vs. not bold) is controlled by the "General" settings of table cards, so it will ignore if you try to adjust it in the HTML tag. Same with font-size.
Here's a super quick example showing how you can color code one variable based on another variable:
Case when
Date
= 'M' THEN
concat('<div style=color:#FF5500>',Network
,
'</div>')else
concat('<div style=color:#0072b2>',Network
,
'</div>')
endFor anything more specific, it would be helpful to know the format of the data you're using, what you're using as your conditions, etc.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Domo does support some basic HTML formatting in Beast Mode, such as
<b>
for bold text, and<font>
tags for color. But, not all visualizations honor HTML formatting in column data. It sounds like you had success in summary but not in the column data itself.
To create a string as bold and color, your formula would be something like:CONCAT('<b><font color="red">', `Your_Column_Name`, '</font></b>')
But it won't render in all table types. If you are trying to conditionally apply formatting based on a value, you could try something like:
CASE
WHEN `Your_Column_Name` > 100 THEN CONCAT('<b><font color="green">', `Your_Column_Name`, '</font></b>')
ELSE CONCAT('<b><font color="red">', `Your_Column_Name`, '</font></b>')
ENDThis would display values greater than 100 in bold green, and all others in bold red.
As you mention, using the "Color Rules" feature is another option. However, the issue you're running into with the transparency making red and green text look too dark is a known limitation. Adjusting transparency can affect the appearance of colors, and the way Domo renders certain shades in tables might not always be ideal.
When I want total control of html colors and such, I move to a blank brick where I can control everything. But the code gets complex and you lose the benefits of Domos ETL, aggregations and such sometimes.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Answers
-
Yes, I have gotten this to work.
Heads up:
- HTML formatting tags only work on Summary Numbers (which you got to work), HTML tables, and Heatmap tables. (Not MegaTables or Pivot Tables).
- Stuff in your HTML formatting might get "trumped" by other properties native to the card. For example, the font-weight (bold/vs. not bold) is controlled by the "General" settings of table cards, so it will ignore if you try to adjust it in the HTML tag. Same with font-size.
Here's a super quick example showing how you can color code one variable based on another variable:
Case when
Date
= 'M' THEN
concat('<div style=color:#FF5500>',Network
,
'</div>')else
concat('<div style=color:#0072b2>',Network
,
'</div>')
endFor anything more specific, it would be helpful to know the format of the data you're using, what you're using as your conditions, etc.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Domo does support some basic HTML formatting in Beast Mode, such as
<b>
for bold text, and<font>
tags for color. But, not all visualizations honor HTML formatting in column data. It sounds like you had success in summary but not in the column data itself.
To create a string as bold and color, your formula would be something like:CONCAT('<b><font color="red">', `Your_Column_Name`, '</font></b>')
But it won't render in all table types. If you are trying to conditionally apply formatting based on a value, you could try something like:
CASE
WHEN `Your_Column_Name` > 100 THEN CONCAT('<b><font color="green">', `Your_Column_Name`, '</font></b>')
ELSE CONCAT('<b><font color="red">', `Your_Column_Name`, '</font></b>')
ENDThis would display values greater than 100 in bold green, and all others in bold red.
As you mention, using the "Color Rules" feature is another option. However, the issue you're running into with the transparency making red and green text look too dark is a known limitation. Adjusting transparency can affect the appearance of colors, and the way Domo renders certain shades in tables might not always be ideal.
When I want total control of html colors and such, I move to a blank brick where I can control everything. But the code gets complex and you lose the benefits of Domos ETL, aggregations and such sometimes.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Yes OK thanks for the help. This definitely helps clarify. I got it to work but only in a HTML table, not Pivot or Mega Tables. Its kindof a bummer because HTML doesn't let me change things like borders etc., but at this point, I think it is what it is. I really need Domo to add a feature in the Color Rules settings to apply only to text. But thanks for the help!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive