Scenario: You have a master list, but you don’t want everyone to see everything in it! You want to synchronize the rows to a child list, and then apply a view with a filter of “[me]” so only a specific audience can only see their own.
Options: You could buy some fancy addons to SharePoint (that could be obsolete in future versions), or you could use the standard good old fashion work-flows to do it for you and guarantee they will work in the future! This talks about the later.
Works With: SharePoint 2007, and SharePoint 2010 (Any versions)
Disclaimer: This process has it’s risks… TEST IT THOROUGHLY! If not done just right, you can put your list in an infinite loop that can cause havoc on your farm… so do it SPARINGLY, and only under last resort circumstances! BTW, I’m not responsible for your disasters! OK, now with that out of the way.
Step 1. Create the master list, and then duplicate it to a child list. (or something similar):
In creating the lists… you have to decide if you want to a.) Just copy data one way or b.) both ways. In other words, it’s super easy to copy data from one list to the other. But if you want to “synchronize” information between the two of them (i.e. someone makes an update in the Master list it either adds a new record, or updates an existing one and vice versa), then you need to go a little further.
Step 2. To handle the synchronization… you need to link the two lists with an “ID”.
The easiest way to do this is simple create a new column in both lists, in the Master List just call it MasterListID, and in the Child List just call it ChildListID:
IMPORTANT! It seems “duplicative” that we are creating a MasterListID in the master list (since it already has a column called ID), but trust me… this is a handy field in terms of workflow readability down the road… just do it, trust me.
Step 3. Setup the Workflows
Easy enough, now you need two work flows. One “Add’s or update the child list”, the other “updates the Master List”:
Step 4. Setup the first workflow: “Add or Update the Child List”
Basic structure of the workflow.
Condition 1: Check to see if an item already exists or not. If it does, update it
Note: Don’t forget to update the ChildList with the Master List ID! You’ll need it later.
Condition 2: If the item doesn’t exist, create a new one
Note: Don’t forget to stop your workflow after either the update or create.
If all you really needed was one way synchronization, you could stop here… but if you need it both ways, read on.
Step 5. Setup the second workflow: “Update the Master List”
Basic structure of the workflow:
Condition 1 (the only condition): Check to see if it exists, if it does update it.
DANGER! PAY CLOSE ATTENTION TO THIS CONDITION!
Check EACH FIELD to make sure they have actually changed! IF YOU DON’T, you will find your workflow constantly updating itself between the two lists, i.e. infinite loop. So check that they are actually different:
You could in this step instead of comparing all the columns, PAUSE the workflow for a couple minutes… and then check the “Modified Date”. If the dates are not the same then you know it changed. But the aforementioned method is about the most full proof way to handle it.
And that’s pretty much it! Follow those steps closely and you have achieved syncronization between your two lists.