Can I format the color of the either font or the column fill on a table card?

I have table card and understand that I can change the alignment or attributes for each column, but this is limited. Is it possible to display text in a column in red or have the fill in one column changed to something other than white?

Best Answer

  • crocija
    crocija Member
    Answer ✓

    Here's the way it is written:

     

    CASE
      WHEN `Security Risk Rating` = 'EXTREME'
      THEN '<div style="background-color:#fcbcb7; color:#800000; font-weight:bold; width: 100%; height:100%; margin:-20px; padding:20px">EXTREME</div>'

      ELSE `Security Risk Rating`
    END

     

    I had help from Domo Support

Answers

  • ckatzman
    ckatzman Contributor

    @crocija, there was a previous post in the Dojo that showed an example similar to what you are trying to do.  Take a look at the post at this link and see if this helps you in the right direction.

     

    https://dojo.domo.com/t5/Beast-Mode-ETL-Dataflow/Number-formatting-when-using-HTML-conditional-colors/m-p/14272#M1083

    **Say thank you by clicking the 'thumbs up'
    **Be sure to select the answer that represents the best solution and mark as "Accept as Solution"
  • kshah008
    kshah008 Contributor

    @crocija, did ckatzman's reply help you out?

  • I'm sorry, but no it did now help. I had already seen the post, but the post fails to explain the actual beastmode formula to type in when creating a new field? Does anybody no that? Let's say the column header is "Totals".

     

    How would I write this in the formula box to make the font red?

  • kshah008
    kshah008 Contributor

    @ckatzman, can you provide further insight? 

  • I would like the data in one column to dispay in red. Under Attributes, I can only adjust to italic, bold, etc.

     

    Show Red Font in Column.png

  • ckatzman
    ckatzman Contributor

    I am not familiar with HTML myself, but there are numerous examples of HTML related inquiries and responses within the Dojo, which can be located by searching "html formatting".  In addition to the one previously provided, here is another that appears to provides some examples of code and results images.

     

    https://dojo.domo.com/t5/Beast-Mode-ETL-Dataflow/Conditional-formatting-of-Columns-in-a-table-view-card/m-p/12495#M881

     

    Generally speaking, HTML coding beast mode is not directly supported by DOMO (or at least that's the professed answer), though the solution/link posted in this response was provided by a DOMOsapien.

    **Say thank you by clicking the 'thumbs up'
    **Be sure to select the answer that represents the best solution and mark as "Accept as Solution"
  • Okay - I do appreciate your help. The formula wasn't exactly correct.

     

    It's actually this: CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a  href="#">', `Outstanding Minor`, '</a></div>')

     

    Not this: CONCAT('<div style="background-color:#fccf84; width: 100%; height:100%; margin:-20px; padding:20px"><a  href="#">', 'Yellow Conditional Format', '</a></div>')

     

    However, I can not set this label to Average. So, I am not able to use this.

     

    How might I beable to have the beastmode created to show Sum, Count, Average, Max, etc.

     

     

  • ckatzman
    ckatzman Contributor

    Combining a conditional test, and an aggregation, could be a simple matter of wrapping a CASE statement in the appropriate aggregation function.

     

    Ex:  SUM(CASE WHEN `TEST` = 'TRUE' THEN 1 ELSE 0 END)

     

    That case could be much more involved with multiple tests, or even nest a CASE within a CASE if you have a two-layer (or more) test to perform.  This second example of a multi-layer might be how you wind up incorporating the conditional formatting.

     

    Ex:  CASE WHEN SUM(CASE WHEN `TEST` = 'TRUE' THEN 1 ELSE 0 END) < 100 THEN CONCAT('HTML1...')

                     WHEN SUM(CASE WHEN `TEST` = 'TRUE' THEN 1 ELSE 0 END) < 200 THEN CONCAT('HTML2...')

                     ELSE CONCAT('HTML3...')

            END

     

    Replace SUM with other aggregation functions depending on the context of your solution.  A quick generic test in my own instance with the following provided expected results...

     

    EepOppOrkAhAh1.PNG EepOppOrkAhAh2.PNG

     

                

    **Say thank you by clicking the 'thumbs up'
    **Be sure to select the answer that represents the best solution and mark as "Accept as Solution"
  • I do appreciate the reply, but I'm not netecessarily looking to heatmap sums based on total. The best scenario would simply be to show the color in this column with the total. Because I can't select average, the table shows all of the records for the user. I simpy when to show the total of 7 for the user's reports.

     

    How might I right this to show average?

     

    2016-08-22_12-34-08.png

  • kshah008
    kshah008 Contributor

    @ckatzman, can you provide further insight? 

  • crocija
    crocija Member
    Answer ✓

    Here's the way it is written:

     

    CASE
      WHEN `Security Risk Rating` = 'EXTREME'
      THEN '<div style="background-color:#fcbcb7; color:#800000; font-weight:bold; width: 100%; height:100%; margin:-20px; padding:20px">EXTREME</div>'

      ELSE `Security Risk Rating`
    END

     

    I had help from Domo Support

This discussion has been closed.