2

I have a publishing page that has a web part showing a list. I want to show the updated time/date of the list in the page displaying the list.

The list contains data that should be updated daily and I would like to show the date when the list was updated. So I need the modified date, but the list contains many items so I only need one date that the list is updated and not the list items. Part of the update of the list includes deleting all items in the list then an import occurs of new items.

  • 1
    Should you elaborate more on this point "I want to show the updated time/date of the list" are you need to show the modified date for each item ? at list view within this page ?! – Mohamed El-Qassas MVP Oct 5 '16 at 11:05
  • Means Last Item Modified Date of the list ? – Ronak Patel Oct 5 '16 at 11:12
  • Yes sorry. The list contains data that should be updated daily and I would like to show the date when the list was updated. So yes the modified date but the list contains many items so I only need one date that the list is updated and not the list items. Part of the update of the list includes deleting all items in the list then an import occurs of new items. – Mike Blair Oct 5 '16 at 11:19
2

You can write a piece of JavaScript code in the page by placing the content editor web part or script editor web part. Or you can include the script in your web part only if it is JS based.

Below is the REST query which may help you to fetch the last modification date-time of the list.

_spPageContextInfo.webAbsoluteUrl + '/_api/web/lists/getbytitle("ListTitle")?$select=LastItemModifiedDate'

You can make Ajax call to this statement. You can select any of the following property of list.

  1. LastItemDeletedDate
  2. LastItemModifiedDate
  3. LastItemUserModifiedDate

Hope this helps!!

  • Thanks for the query I haven't used REST before, how do I implement this in a page? – Mike Blair Oct 6 '16 at 6:59

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.