Showing All Versions of “Append Changes to Existing Text” in a Data View Web Part (DVWP)

While flying across the country to SPTechCon SFO 2011, I was going through some of my old “blog posts I should do sometime” lists and came across this cool trick. Brendan Horner (@hornerit) shared it with me months ago via Twitter and I socked it away for one of those extra moments. Well, I found that moment. It’s not something which hasn’t been written about before, but it’s something I’m asked about from time to time, and I never remember how to do it, so here you go.

imageYou’ve probably used the “Append Changes to Existing Text” trick in a list at least once. If not, here’s how it works. You have to have versioningĀ turned on for the list for this to work. Then if you create a Multiple lines of text column, at the bottom of the settings you’ll see the option.

image

Setting the option to “Yes” lets you keep a sort of running log in that column. I’ve used it many times in tasks lists so that each person can add their $.02 during the process.Ā Here’s what it might look like (with some silly test data):

One problem with this cool functionality is that in views, you don’t get to see the strings of text, just a link that takes you to the DispForm for the item. It’s a cumbersome UI choice, for sure.

So naturally, we’d like to be able to turn to a Data View Web Part (DVWP) to improve the user experience. To make this work, you need to add the following line into your XSL:

<SharePoint:AppendOnlyHistory FieldName="Comments" runat="server" ControlMode="Display" ItemId="{@ID}"/>

When you do this, you get a nice listing of the history, like this:

Much nicer! Thanks, Brendan.

Similar Posts

106 Comments

  1. I know this is quite an old post, but I really need this functionality to work with my SP2016 website. Unfortunately I can’t find a DVWP here… And I can’t use SP Designer.
    Is there a way to use this code with an XML Viewer Webpart or a Script Editor?
    Thanks in advance!

  2. Hi Marc,

    Very smart solution this is, I want to display the same in AgilePoint workflow – capturing all technical updates for a ticket in multiline text on each update, these updates should go in mail which is triggering from AgilePoint workflow. Please let me know if you have any suggestions here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.