none
HTML in calculated fields not working in modern listviews RRS feed

  • Question

  • Hi! I'm having trouble with some old calculated fields in a SharePoint Online server.

    I have used the classic trick to render HTML by setting the return type in the calculated field as number.

    It works as long as I render the page in the classic SharePoint look. But when I render the page in modern view it shows the HTML code in the column, not the nice looking rendered colorfilled circles that I create out of html and css :(

    Does anyone got a solution?

    Friday, February 17, 2017 10:13 PM

Answers

  • Hi Magnus,

    Not like the classic look, the modern view is introduced and work in a different way from the original one, the rendering method of it is also different, some scripts which might work in the old time is not guaranteed to be still working now.

    It is recommended officially that you still apply the classic look to your list view currently for letting your customization work as you expect.

    A fact is that, SharePoint Online keeps updating by the Product Team all the times, if you have any expectation about the future version, it is encouraged that you submit a feedback to the SharePoint UserVoice Platform:

    http://sharepoint.uservoice.com/ 

    It is a place for customers provide feedback about Microsoft Office products. What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

    You can also keep tracking the updates(for products and APIs) that are currently planned in Office 365 Roadmap:

    http://fasttrack.microsoft.com/roadmap   

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 20, 2017 7:21 AM
    Moderator

All replies

  • Hi Magnus,

    Not like the classic look, the modern view is introduced and work in a different way from the original one, the rendering method of it is also different, some scripts which might work in the old time is not guaranteed to be still working now.

    It is recommended officially that you still apply the classic look to your list view currently for letting your customization work as you expect.

    A fact is that, SharePoint Online keeps updating by the Product Team all the times, if you have any expectation about the future version, it is encouraged that you submit a feedback to the SharePoint UserVoice Platform:

    http://sharepoint.uservoice.com/ 

    It is a place for customers provide feedback about Microsoft Office products. What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

    You can also keep tracking the updates(for products and APIs) that are currently planned in Office 365 Roadmap:

    http://fasttrack.microsoft.com/roadmap   

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 20, 2017 7:21 AM
    Moderator
  • Hi,

    Place script editor  web part at the end of page and paste the following script to see if it works.

    <script type="text/javascript">

    var theTDs = document.getElementsByTagName("TD");

    var i=0;

    var TDContent = " ";

    while (i < theTDs.length) {

    try {

    TDContent = theTDs[i].innerText || theTDs[i].textContent;

    if ((TDContent.indexOf("<DIV") == 0) && (TDContent.indexOf("</DIV>") >= 0)) {

    theTDs[i].innerHTML = TDContent;

    }

    }

    catch(err){}

    i=i+1;

    }

    }

     </script>

    -Varinder

     

    varinder

    Monday, February 20, 2017 11:24 AM