0

I have a SharePoint List that gets updated by users on a regular basis in our SharePoint 2010 instance.

At the start of every month (i.e. 11/1/2013) I want to copy that list to another location as a sort of archive. I would like to have a drop-down menu where I can view past months' copies of the list.

Any easy way to do this?

Thanks so much!

1
  • can't you just play with views and calculated columns? IE keep data at the same place, but with display filters?
    – Steve B
    Oct 31 '13 at 21:11
1

You can create an information policy which can move items based on a variety of rules. If it is for a single source list then go into the list settings-> Information management policy settings. You will probably find it is set to content types by default but you can change this to be list specific and then add and configure your own retention stage.

0

you could use a workflow coupled with the sharepoint workflow activities (copy list item extended) from codeplex. then use views to filter the data as suggested.

1
  • 1
    A workflow does not feel as the best man / girl for this job. Scheduled stuff always makes me think "timer job" Nov 1 '13 at 6:54
0

You can use the taskscheduler that triggers a powershell to export the list and copy to another location. Powershell to copy list items

Another way is to create a Timerjob to copy all list items to another list

0

Thank you so much to everyone who responded!

I found a way to archive the data which, for my use case, is more efficient than copying the entire SharePoint list web part to a new list web part. I am pulling all the SharePoint List fields into a JavaScript array using SPWebServices

function archive(){

      //The Web Service method we are calling, to read list items we use 'GetListItems'
    var method = "GetListItems";

    var archiveGroupArray = new Array();
    var archiveBFArray = new Array();
    var archiveSPriorityArray = new Array();    

    //The display name of the list we are reading data from
    var list = "Scorecard";

    var fieldsToRead =     "<ViewFields>" +
                            "<FieldRef Name='Team_x0020_Member' />" +
                            "<FieldRef Name='Score' />" +
                            "<FieldRef Name='Weight' />" +
                            "<FieldRef Name='Description2' />" +
                            "<FieldRef Name='Group' />" +
                            "<FieldRef Name='Strategic_x0020_Priority' />" +
                            "<FieldRef Name='Title' />" +

                        "</ViewFields>";

     var query = "<Query>" +
                    "<Where>" +
                        "<Neq>" +
                            "<FieldRef Name='Title'/><Value Type='Text'></Value>" + 
                        "</Neq>" +
                    "</Where>" +
                    "<OrderBy>" + 
                        "<FieldRef Name='Title'/>" +
                    "</OrderBy>" +
                "</Query>";
    //Here is our SPServices Call where we pass in the variables that we set above
    $().SPServices({
            operation: method,
            async: false,  
                           listName: list,
            CAMLViewFields: fieldsToRead,
              CAMLQuery: query,
                  //this basically means "do the following code when the call is complete"
                completefunc: function (xData, Status) { 
                      $(xData.responseXML).SPFilterNode("z:row").each(function() { 

                        var funct = ($(this).attr("ows_Team_x0020_Member"));
                        var score = ($(this).attr("ows_Score"));
                        var weight = ($(this).attr("ows_Weight"));
                        var description = ($(this).attr("ows_Description2"));

                        for (var y=0;y<GradeArray.length;y++)
                            { 
                                var index = GradeArray[y].indexOf(score);

                         if (index > -1){score = GradeArray[y][1];}

                            }

                        for (var t=0;t<WeightArray.length;t++)
                            { 
                                var index = WeightArray[t].indexOf(weight);

                         if (index > -1){weight = WeightArray[t][1];}

                            }

                        var title = ($(this).attr("ows_Title"));
                        var grcgroup = ($(this).attr("ows_Group"));
                        var spriority = ($(this).attr("ows_Strategic_x0020_Priority"));

                        var found = 0;

                            for (var z=0;z<archiveSPriorityArray.length;z++)
                                {
                                var index = archiveSPriorityArray[z].indexOf(spriority);
                                if (index > -1){
                                found = 1;
                                var name = spriority;
                                var desc = description;
                                var totalweightscore = (archiveSPriorityArray[z][1]) + (score*weight);
                                var totalweight =  (archiveSPriorityArray[z][2]) + (weight);
                                archiveSPriorityArray[z] =  ([name, totalweightscore, totalweight, desc]);
                                archiveBFArray.push(archiveSPriorityArray[z]);
                                archiveGroupArray.push(archiveBFArray);
                                                }
                                }
                            if (found != 1) {
                                        var name = spriority;
                                        var desc = description;
                                        var totalweightscore = (score*weight);
                                        var totalweight = (weight);
                                        archiveSPriorityArray.push([name, totalweightscore, totalweight, desc]);
                                                    }                
                    });    //end   xdata        
                }//end completefunction  
    });//end  SPServices

    }//end archive Function    

Then I submit the array to PHP and generate a CSV file of the data. Each month generates a new CSV file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.