none
Moving document set from one document Library to another library in same site?

    Question

  • Can Anyone  tell me a solution on moving document set from one document Library to another in same site[SharePOint Online]?

    Possible solution tried -

    1. Send to  dont work for Document Set

    2. SPD workflow  not moving the document set

    3. Send to another location cannot be used in our situation as  the configuration at the tenant level will be applicable to all the site collections and not for a specific site.

    4. Any client side script can be used. If yes, please help as this is not found to be available any where? 

    Please suggest the solution for this if third party app cannot be used.

    Tuesday, January 10, 2017 6:59 AM

All replies

  • Hi

    have you checked this workflow solution?

    https://plumsail.com/blog/2016/09/how-to-copy-documentset-to-another-library-in-sharepoint-online/


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Tuesday, January 10, 2017 7:21 AM
  • Hi PamShukla,

    As of now OOTB solution is not available to move document set from one library to another library even Move / copy action from "Site Content and Feature" is not worked for Document set as it is supported only file and items.

    We have faced similar issue and raised this to Microsoft, they provided custom solution with new CSOM dll (Version 16.1.4727.1200).

    For more information on this release read here

    https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365

    By this new DLL, you can export the document set and from target location and import it on source location.

    Sample code is here.

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.SharePoint.Client;
    using Microsoft.SharePoint.Client.DocumentSet;
    
    namespace DocSetCSOM
    {
        class Program
        {
            static void Main(string[] args)
            {
                if (args.Length != 2)
                {
                    Console.WriteLine("Usage: DocSetCSOM.exe <newDocSetName> <docSetContentTypeName>");
                    return;
                }
                ClientContext context = new ClientContext("http://SPHVM-0311/");
                ContentTypeCollection contentTypes = context.Web.ContentTypes;
                context.Load(contentTypes);
                context.ExecuteQuery();
                //ContentType ct = context.Web.ContentTypes.GetById("0x0120D52000947B8344041D1340BEB4CE61C5049D11");
                //context.Load(ct, c => c.Id);
                //context.ExecuteQuery();
                ContentType docSetContentType = null;
                foreach (ContentType ct in contentTypes)
                {
                    if (ct.Name == args[1])
                    {
                        docSetContentType = ct;
                        break;
                    }
                }            
    
                List list = context.Web.Lists.GetByTitle("Documents");
                List target = context.Web.Lists.GetByTitle("target");
                Folder folder = context.Web.GetFolderByServerRelativeUrl("target/xyz");	
                ListItem listItem = list.GetItemById(2);
                
                DocumentSet docSet = DocumentSet.GetDocumentSet(context, listItem.Folder);
                ClientArrayResult<byte> data = docSet.ExportDocumentSet();
                context.ExecuteQuery();
    
                DocumentSet newDocSet = DocumentSet.ImportDocumentSet(context, data.Value, args[0], folder, docSetContentType.Id, context.Web.CurrentUser);
                context.ExecuteQuery();
    
                Console.WriteLine("Done");
            }
        }
    }


    Vivek Jagga
    My Blog
    Follow Linkedin Group   



    • Edited by Vivek Jagga Tuesday, January 10, 2017 9:22 AM
    • Proposed as answer by sadomovalexMVP Tuesday, January 10, 2017 9:42 AM
    Tuesday, January 10, 2017 9:21 AM
  • Can Anyone Please provide Microsoft.Office.DocumentManagement.DocumentSets.dll this dll for sharepoint online?
    Thursday, January 12, 2017 10:34 AM
  • Hi,

    This dll is only for SharePoint on-premise. There is a client object model version of Microsoft.SharePoint.Client.DocumentManagement.dll. This dll contains the following methods:

    • public method Microsoft.SharePoint.Client.DocumentSet.DocumentSet.ExportDocumentSet
    • public method Microsoft.SharePoint.Client.DocumentSet.DocumentSet.GetDocumentSet
    • public method Microsoft.SharePoint.Client.DocumentSet.DocumentSet.ImportDocumentSet

    Check this link for the included dll's in SharePoint CSOM: https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365





    Thursday, January 12, 2017 12:29 PM
    Moderator