I have one SPList -say List1- with some 400 items with single line of text, dropdown, lookup,peoplepicker, multiline fields etc.
I need to copy the entire from this List1 to a new list that has different set of columns.if List1 has 30 columns then my new list List2 has 46 columns. How do I perform this?

I do not have Central Admin access for this application. What should be the approach for achieving this:

  • Should I go with CSOM within a CEWP? If CSOM, can anyone please provide source/links
  • Should I use C# coding, if this is the approach, I can't use Server Side OM as I am not working on the server
  • 5
    • Just make a list template of the list from site settings, include the content and use the template to create "List2" and add the additional columns. No code needed. Commented Dec 17, 2015 at 14:26
    • That wont work.I already tried as my source list columns and target list columns are different.
      – samolpp2
      Commented Dec 17, 2015 at 14:30
    • 1
      Sounds like a job for Powershell. Commented Dec 17, 2015 at 14:35
    • @SaMolPP, i misunderstood your question. Commented Dec 17, 2015 at 14:41
    • @DylanCristy, i don't have access to the server where SP is installed. I have access upto site collec.admin ONLY. So cant think of writing PS Script.
      – samolpp2
      Commented Dec 17, 2015 at 15:07

    1 Answer 1


    This only clones/duplicates an item in the currect list, so you have to add

    • Create a second list B (not in this code)
    • loop items in list A (not in this code)
    • create item in list B (n)
    • use while loop (e,f) to loop List A fields
    • write required fields to list B (n,m,v)

      function cloneItem(id) {
      var c = new SP.ClientContext.get_current(),
          l = c.get_web().get_lists().getById(SP.ListOperation.Selection.getSelectedList()),
          i = l.getItemById(id),
          f = l.get_fields(),
          n, e, d, m, v,
          url = _spPageContextInfo.serverRequestPath;
          function () {
              n = l.addItem(new SP.ListItemCreationInformation());
              e = f.getEnumerator();
              while (e.moveNext()) {
                  d = e.get_current();
                  m = d.get_internalName();
                  if (!(d.get_readOnlyField() 
                         || d.get_hidden() 
                         || ['Attachments', 'ContentType'].indexOf(m) > -1)
                     ) {
                      v = i.get_item(m);
                      if (v) n.set_item(m, v);
              c.executeQueryAsync(function () {
                  var newID=n.get_id();


    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.