Remove Sum text from SharePoint 2013 Online List View using JavaScript

This SharePoint tutorial explains, how to remove “Sum=” text from SharePoint 2013 list view. Here I have a SharePoint 2013 list where I have a Salary column. I am displaying the total Sum for the Salary column by following this article.

Here below to the Salary column, the sum is displaying as Sum=37,000.00. It displays like below:

Remove Sum text from SharePoint 2013

But my requirement is to remove the “Sum=” text, I just want to display the total sum.

Remove Sum text from SharePoint 2013 Online List View using JavaScript

Remove Sum text from SharePoint 2013 Online List View using JavaScript

This we can do by writing a simple JavaScript code. Open the SharePoint list view page then edit the page. In edit mode add a web part and choose script editor web part in SharePoint. Then put the below code inside the script editor web part.

<script type="text/javascript">

function hideSum(myString) {
var docTags;
docTags = document.getElementsByTagName("B");
for (var i=0; i < docTags.length; i++) {
docTags[i].innerText = docTags[i].innerText.replace(myString,"");
}
}

_spBodyOnLoadFunctionNames.push(‘hideSum("Sum=")’);
</script>

Now you will not able to see the Sum= text. It only shows the total sum.

You may like following SharePoint customization tutorials:

This SharePoint tutorial explains, how to remove Sum text from SharePoint 2013 Online List View using JavaScript.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>