Slinger's Thoughts

February 4, 2008

Creating a workflow to update a list across a site collection.

Filed under: SharePoint — Tags: , , , , — slingeronline @ 2:29 pm

We have a unique situation, but the solution is not unique.  One of the things that Microsoft missed when designing SharePoint, was that not everything can go in one site for a company.  More likely it would be a site collection.  Just to give you an idea, we are a small engineering firm.  We have clients, and vendors.  And the employees here.  And all of them will need access to something in SharePoint at one time or another.  We also want to keep everyone’s information organized and separate.  We could set permissions on a Document Library and List level, but that would be too intensive to maintain for our IT department. (Specifically, me.)  So our solution was to have one site collection that contains everything, and keep everything separated by sites and subsites.  Our clients have access to everything that we do, limited by permissions to only their own information. Which makes it horrendously easy on me.  For each new project site, I simply add all authenticated users and the whole company gets access, then add form based authentication users for each client to access only their own information.  Well, here’s where an issue comes in.  Our vendor’s need access to all of that same information.  We don’t want vendor’s to be able to see each other’s information.  Our vendor’s may also work with more than one of our clients at a time.  So, clients and vendors should only be able to see their own information at any given time.  Well we could go with item level security for our vendor’s but that really doesn’t make much sense.  What we did was set each vendor up with their own subsite.  Which works well.  The problem is getting at least a copy of a document in a client site to the appropriate vendor site.  Well, you can create a workflow that creates a copy of an item in a document library or a list to another document library or list.  Which is a great feature, but it can only be in the same site or sub-site, which makes that great feature pointless.  I don’t think I would ever need to copy an item to another list on the same site.  Why wouldn’t I just go to that list then?  Now, in another site, with a completely different set of permissions, makes a lot more sense.  I can create a workflow using Microsoft’s SharePoint Designer software, but there is that limitation of only being able to link to another document library in the same site.  Well, I found something on CodePlexthat fixes that.  I highly recommend codeplex for any SharePoint or MOSS admin.  They have a wealth of useful tools that I frequently take advantage of.  So I install the custom workflow activities feature and activate it for my web application.  Now I have a wonderful new ability.  I can update lists and document libraries in the next county, not just in the next room so to speak.  Permissions may be an issue for some if you’re needs are different, but it shouldn’t be an issue for me.  So I create a workflow in a document library on our client’s site, and I set the conditions to fire the workflow automatically whenever an Item is added or modified.  Then I tell it to watch one of the columns of metadata to match a certain condition.  If those conditions match, I tell the workflow to make a copy of that file into a document library.  And now I have a new option in SPD (SharePoint Designer).  I can select “Copy List Item Extended” from the “Actions” drop down.  And now my SPD looks a little bit different.  Next to Actions it says “Copy item in this list to list at this url, Overwrite existing items…..” and so on.  I didn’t have that url option before.  All I have to do, is add the full url of the list or document library, and now, whenever SampleVendor A’s item shows up in Client A’s document library, it gets copied to SampleVendor A’s document library so that SampleVendor A can access the file.  Fantastic!  I couldn’t use the Content Query Web Part because that only creates a link to the file.  Well, we have not given SampleVendor A access to the client site, because the client site also contains information for SampleVendor B and C.  And we don’t want to do that the other way around for the same reason.  So with this new feature installed, our problem is solved.  There are other features added as well, but we don’t have a need for those yet.  This was definitely worth it.  And it was functionality that should have been there to begin with. There are a few things to watch out for.  If you have a space in your URL, you need to make sure that it didn’t get translated as %20, and don’t include the “forms/allitems.aspx” or whatever the view setting is, as this isn’t actually the location of your list or document library.  Now, if only I could get it to pass all the metadata along with the file.  That will be my next task.

9 Comments »

  1. Re: “Now, if only I could get it to pass all the metadata along with the file. That will be my next task.”

    i’ve noticed that if columns are named identically (not just the display name, but also the name that shows up in the url bar when editing that particular column) metadata seems to move too. maybe that’s just within a site collection, but it’s something to check out. as for “copy list item extended” functionality, that’s exactly what i need. thanks for posting!

    Comment by andrew — July 30, 2008 @ 10:23 pm

  2. I used this to create a rollup for projects to a master list for our CIO. Works great with one flaw. I tried to get it to overwrite the current item on the rollup when some one “changes” an item. Instead it puts an identicly name item into the rollup list with the updated info. Any ideas?

    Comment by Bryon — October 20, 2008 @ 12:58 pm

    • bryon – Copy Item Extended will do this. The reason is that the ID of the item being copied is not the same as the ID in the list you copy to. This will fail until we can define what we are using as the common field identifying the item being copied.

      Comment by travellermac — June 14, 2013 @ 3:05 pm

  3. I ran into something similar. It would always create a new item instead of simply overwriting the file that was there. What I eventually wound up doing, was instead of copying the file using the built in workflow, I had to use one of the Extended workflow activities. Using the extended copy activity gives you the option to “Overwrite” the existing item. Out of the box, this isn’t supported. Make sure that you are using the “Copy Item Extended” action instead of the “Copy Item” action. It’s a little more to configure, but it’s worth it.

    Comment by slinger — October 21, 2008 @ 6:40 am

  4. What did you used from codplex that helped you with lists in site collection?

    thanks

    Comment by Amir — January 27, 2009 @ 6:54 pm

  5. Hi,

    the codeplex information is gone, can you please give me any more details or the package that you downloaded?

    Comment by Kelly — December 14, 2009 @ 8:48 pm

  6. Have they updated this for SP2010, I don’t see any reference

    Comment by Bob Elander — December 1, 2011 @ 1:10 pm

    • Unfortunately no. Much of the functionality from the original codeplex solution was included in 2010 by default, but the cross site collection reference is missing. Something I might be able to work on in the near future though. I’m sure there is a way to get it done, jsut need to find out how to break SharePoint 2010 the right way.

      Comment by Jay Strickland — December 1, 2011 @ 1:17 pm

  7. I am using sp2003 is it possible to update a list in one site as and when the other site list is updated? can you please guide me how? bazaleel@gmail.com

    Comment by Bazaleel Raja — April 5, 2012 @ 1:54 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Create a free website or blog at WordPress.com.