2

Is there any way to get number of views count for each post in discussion board in SharePoint out of the box? or is there any custom code sample to achieve the same?

I know Popularity trend is there, but not that much useful to check every post in discussion board.

Please let me know any feasible way to achieve it..

  • I found some similar Questions, take a look at this one and this other one. Also try browsing through the 'Usage-Counters' tag in the menu, this seems to be the term used on this site for what you are trying to implement. I saw an item-view somewhere too, which is what you ask for. – Tally Feb 6 '18 at 12:03
2

You can access the data via a rest call to the search service:

http://sp/_api/search/query?querytext='path:"http://sp/Lists/DiscussionBoard"'&rowlimit=100&sortlist='viewsrecent:descending'

In the results of the REST call, look for the ViewsRecent and ViewsLifetime fields.

  • Hi, Thank you for your solution. I'm getting values for ViewsRecent and ViewsLifetime. Can you please elaborate more on these two terms? What is the meaning on each? – Swapnil Lad Feb 7 '18 at 8:34
  • Hi, I found the answer. "ViewsLifeTime" : shows the hit count from the first day a usage event was recorded. The "ViewsRecent" shows the hit count for the last 14 days by default. – Swapnil Lad Feb 7 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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