Thursday, May 11, 2006

Recently Updated documents in SharePoint

UPDATE ON 11/22/2008: This was written way back when I was working with WSS 2.0/SharePoint 2003. Please see Ryan's blog post for some updates with regards to WSS 3.0/MOSS 2007.

I came across this tip a while back, and had to reconfigure one of our document libraries today because I broke it. I figured I'd put the tip here in case I forgot it again, since I can't find it again.

How to make a Recently Updated view in a SharePoint Document Library

In the document library, click Modify settings and columns

Under Columns, click Add a new column

Add a column called "Today" as a Single line of text column.

Click Add a new column again and add a column called "ViewUntil" with the following settings:

Type: Calculated (calculation based on other columns)

Formula: [Today]+7

Data type returned: Date and Time, Format: Date Only

Unclick Add to default view

Delete the "Today" column that you created earlier

Back on the Customize document library screen, click Create a new view

Call the view "Recently Updated" or whatever you want. Choose whatever columns you wish, but make sure to include the "ViewUntil" column. Sort however you like.

Under Filter, select Show items only when the following is true

Show the items when column "ViewUntil" "is greater than or equal to" "[Today]" And "Modified" "is greater than or equal to" "5/4/2006" (replace with the date from seven days ago)

Click Ok and now you have a list view that shows documents updated in the past week. It will be updated whenever a user adds or modifies a document.

31 comments:

Anonymous
said...

Joel,

Good comments, but not the answer I need...

I want to have a dynamic list of how long a document has been on a list. i.e. Each day when I look at the list the document should be seen as a day older. I can create the "aging" field (using the [Today] trick posted other places on the net...) but its static, once the document is created, it only is updated when the document is edited...

Hi Joel, I have been through your instructions, but I am none the wiser. It appears as a view, but if I update an document or upload a new one it doesn't apppear in the Recently Posted view, also how do I add it as a web part.

How are you uploading the files to the document library? I believe this only works if you upload a document via the SharePoint website. If you upload a document using Network Places (e.g. \\server\sitename\document library), I don't think the proper field gets populated.

Why don't you calculate the ViewUntil field as =[Modified]+7 and create a "Recently Modfied" view which filters all items for which ViewUntil is greater than or equal to [Today]. This way there should be no need to adjust the date in the filter.

In Sharepoint 2003 I have a issue list. I have a column named "Contact Date", which has a Date & Time Format. The default value is set to Today's date. I would like to have another column called "Due Date" which shows the current date & time plus 1. (For example: If the current date and time was 7/19/07 10am 05 in the "Contact Date" column I would like the "Due Date" to be 7/20/07 10am 05. With putting "=[today]+1" in the calculated field of the "Due Date" I am able to have it show 7/20/07, but it doesn't show the present time. How do I do that?

Oh, this looks good. Here's a variation. I want to create a view that will show all documents that have a "Meeting Date" of the current month - so if it's November, I'll see all documents for November meetings, if it's December, the December meeting doc set, etc.

I want to use the view with a web part on the site home page so that the docs for the current month's meetings display, then people can go to the library for the year's meeting docs.

I also have a column called "Meeting Month" that is a written out version of the month (January, February, March, etc.) which I use for grouping, if that gives you a handle.

I am trying to put the record straight that this DOES NOT WORK in WSSv3/MOSS. It will not update, see http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/ for details and some workarounds.

You can modify the view for a list or library web part to do the same thing, if the list or library is part of the same "site."

I assume your issue is that you have a lot of subsites and want to aggregate the most update items on the home page.

I haven't done this myself, but it should be possible with the MOSS Content Query Web Part or the Data View web part (in SharePoint Designer). It's not as straightforward as editing a list web part, but they're actually more powerful if you know how to manipulate them.

Your instructions on how to show "recently updated/added" documents have been very helpful. However, I still have a problem with the way Share Point ends up displaying this on my homepage:

When uploading/modifying a single document (e.g. .ppt) that is located in a folder, Share Point shows the folder under instead of the actual document that has been modified. How can I program Share Point to only show me the document and not the folder where the document is located?

In the view settings (either in the list or in the web part) you can turn off the display folder hierarchy and just show all documents in a flat structure (and use filtering of metadata to navigate). Check out the "Folders" section in the list view settings page. Expand the "Folders" section and choose "Show all documents without folders".

Will your technique allow a single document that has been updated multiple times to display a separate entry for each update? I'm trying to find a way to display it so that it lists recent changes, as opposed to just recently changed documents.

The documents I work with update frequently concerning policy, and I keep a list of recently updated documents on the front page so that staff can read the version comments to see what has changed.

Thus far, though, if I update a single document more than once, it simply moves that document to the top of the list and replaces the older update with the new one, and that is less helpful.