Im using sharepoint Data View Web Part, I just want to get the Count of recently added items count from list mean which have "NEW" tags

enter image description here

the above image has two new items so it should show "2" in count ...

  • How are you trying to fetch the data? JavaScript? Dec 24, 2015 at 10:14
  • No,we are using default data viewer webpart.
    – sivajn
    Dec 24, 2015 at 10:18
  • You can change in XSLT file of data view web part. Add your business logic in XSLT file and data view web part to site.
    – Dipen Shah
    Dec 24, 2015 at 11:15
  • You could just count items where the created date is greater than or equal to 3 midnight's in the past. So let's say I created an item right now (12/24 9:26 am). It's marked new because it was created after 12/22 12am.
    – Erin L
    Dec 24, 2015 at 15:27

1 Answer 1


You can use JSLink to add both the jQuery library and an external .js on the data view web part like this:


and add the following code:

    var newItemsCount = $(".ms-newdocument-iconouter").length + " new items";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.