I'm using a script-based solution to add a Comment Box to dispform.aspx in a MOSS document library. The comments live in a separate list and I have a requirement to show the Name metadata from the document library in every item in the comments list. The only metadata passed from the library to the comments list is the URL of dispform.aspx, e.g. http://sitename/library/dispform.aspx?ID=1.

If I could parse out the ID in a calculated column or with workflow (I need a no-code solution) with something like substring-after([URL],"=") then I could use workflow to fetch the Name metadata but I can't seem to work out the method to extract the ID from that URL string. Probably missing something obvious (as usual) but could use some help. Suggestions?

1 Answer 1


I believe you can just do this with connected web parts or filter web parts. If you append &pageview=shared&toolpaneview=2 to the end of your URL, you should enter the edit page for the DispForm.

From there, you could drop a query string filter web part (assuming you're on MOSS Enterprise) and the web part to your comments list. Configure the query string filter web part to pass the ID value to the column in your comments list that stores the lookup reference to this master list. This is assuming you've architected the lists in that fashion.

If that doesn't work, you might be able to utilize some of the other filter web parts to accomplish the same thing for a no code solution.

  • Close, but I think that in order to use this I need to actually write the ID value for the doc library from the URL to a column in the CommentBox list (or at least to a workflow variable) so that I can ultimately fetch the document name from the doc library and write it to a column in the CommentBox list. That way I can use the document's name in alerts that I send when new items get written to the CommentBox list. Confusing enough for you? Jan 6, 2012 at 20:16
  • Yes, I was making that assumption that the comments list had a lookup column or some piece of relational data to the document library so you'd be able to make that connection. If that type of linkage isn't there, you'll be hardpressed to make any solution work as you won't know what data to pull. Jan 6, 2012 at 20:20
  • Thanks Eric, that's where I was stuck as well... the URL contains the ID value (embedded of course) that I was hoping to use to link the two lists but I can't parse it for use in my workflows. Looks like SPServices might be a solution, starting a thread with Marc Anderson now. Jan 6, 2012 at 21:46
  • You can use the item ID in workflows. You just have to have some sort of means to store it. A single line of text or number field works, but a lookup column works better. Jan 6, 2012 at 21:50

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.