HTML code is not working in table view

Hi Folks,

I am pretty new in DOMO and need your help.

I tried with the following code in DOMO beast mode.

CASE WHEN DATEDIFF(CURRENT_DATE(), `Last updated Date`) > 3 then concat('<div style="color:red">',`Last updated Date`, '</div>')

ELSE concat('<div style="color:green">', `Last updated Date`, '</div>')

END


but, it doesn't display anything on the table. I tried with save and close and checked in the browser but nothing.

Tagged:

Best Answer

  • MarkSnodgrass
    MarkSnodgrass Portland, Oregon 🔴
    Accepted Answer

    odd. I just did a test and it worked.

    My beast mode looks like this which is just a copy and paste of what you shared but changed the date field to match the covid dataset field.


    CASE WHEN DATEDIFF(CURRENT_DATE(), `date`) > 3 then concat('<div style="color:red">',`date`, '</div>')
    
    ELSE concat('<div style="color:green">', `date`, '</div>')
    
    END
    

    Do you have any other properties set? Something in the chart properties could be overriding it.

Answers

  • MarkSnodgrass
    MarkSnodgrass Portland, Oregon 🔴

    The basic table card supports a limited amount of HTML in it. To do what you want to do, you need to choose the HTML table card type. This is found under Tables and Textboxes in the chart types dropdown list.


  • ankt84
    ankt84 ⚪️

    Thanks MarkSnodgrass for the prompt response.

    I already tried with HTML table too, but again no result.

    Thanks

  • ankt84
    ankt84 ⚪️

    I don't see any property set on the chart, but I did apply reset on all properties and magically it's working now.

    Thank you, sir.

  • MarkSnodgrass
    MarkSnodgrass Portland, Oregon 🔴

    @ankt84 that is great to hear it is working! I have had to do the reset chart properties from time to time when something isn't working as expected. If you can mark my answers as accepted, that will help others in the community.