Bulk Add Document Set

Hello,
Is there a way to bulk create document set in SharePoint? I saw mutliple way to bulk add "simple" items but I can't find a way to do this with document set (or better with my custom document set type)
My target is to read an xml file containing IDs and create in a document library a document set for each entry..
for now i'm using a web service that I call with PowerShell but it is too slow for me (I need to import a lot of document sets) ... is there a faster way?
Thanks in advance
Christopher
Best regards, Christopher.
Blog |
Mail
Please remember to click "Mark As Answer" if a post solves your problem or
"Vote As Helpful" if it was useful.
Why mark as answer?

I'm thinking, a faster way would be to leverage the client OM to upload files in batches. Each batch gets a little bit bigger because files get Base64 encoded, but according to my tests it's well worth the effort. In my case, I was able to make the
code run 10 x faster. Here's some example code to get you started:
// Run some kind of loop to add batch of files
FileCreationInformation fileCreationInformation = new FileCreationInformation();
byte[] content = fileContent;
fileCreationInformation.Content = content;
fileCreationInformation.Overwrite = true;
fileCreationInformation.Url = fileName;
this.CurrentList.RootFolder.Files.Add(fileCreationInformation);
// End of loop, now execute in 1 batch:
Context.ExecuteQuery();
This code is for individual files, not for document sets, but I guess you'll be able to figure that out. I once built a tool that leverages the concept of batch uploading files, you can check that out as well at
http://gallery.technet.microsoft.com/office/The-Migration-Dragon-for-c0880e59/view/Discussions
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com

Similar Messages

  • Workflow: create a document set and add default documents to it

     
    Having a workflow create a new document set seems straightforward: use the "create list item” action, choose the target library and one of the document set content types available in it
    and supply values for the fields. But that workflow action doesn't provision the document set with default content, even though the content type has default content defined. Other people have asked the same question and some say you can write a second workflow
    triggered by creating the new document set item in the target library, but I don't see how you can add default content to it.
    "Copy list item" would work if you could supply the title of the document set along with the target library. You can copy files (in my case several .msg, .pdf and .docx files) from
    a "templates" library, but without being able to add the document set name/path as part of the target "this list" they end up in the root of the target library not in the document set.
    I've seen suggestions that "Create list item" will work, but I don’t see how it can since with that you can't supply a file name to provide the default content with.
    Am I missing something?
    Tom
    SharePoint Systems Officer, Capital Regional District, BC, Canada

    Hi Tom,
    According to your description, my understanding is that you want to add documents to the document set using workflow.
    I recommend to use the custom workflow activity “Copy List Item Extended” and you download it from the following link:
    http://spdactivities.codeplex.com/.
    With this activity, we can copy documents to document sets.
    Please refer to the link below to deploy the custom activity:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/24f21b48-0078-4c18-bd3e-180cd2291c28/moving-items-into-library-foldersdocument-sets-infopathspd-2010-workflow
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Using Document Sets when I add Default PDF the save location is wrong.

    Using Document sets you can add "Default Documents" to load when you use this function.  The file are stored in a separate document library, template location.  
    Once the user uses the function the file deploy and show in the right folder.  The problem is when someone edits a PDF form from the folder and then tries to save, the default save location is back to the template location.  I've lock
    the document but it a pain for the user to have to thumb their way back to the right place to save.
    Is this just a Adobe vs Microsoft fight?  
     

    See this:
    https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox

  • How to add a file in Document Set using ECMA script?

    Hi,
    I want to upload a particular file into Document set using ECMA script.
    I can do it easily through C# but unable to achieve the same using ECMA Script.
    Any pointers or piece of code will be helpful.
    Thanx in advance :)
    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"

    The following blog post provides a way to create a document set using ECMA:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    The following blog post provides a way to upload files into a document set using CSOM:
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    See if you can follow the logic in the CSOM example to apply it to ECMA. Let me know if you have specific problems with it.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Can you copy the Temperature in Delivery Note to Bulk Shipment document?

    Is there a way to copy the temperature inputted in the "Qty in Alternate UOM" tab in the item details of the Delivery Note to the Bulk Shipment document during the Change Loading confirmation process?
    One of our process requirements is to be able to copy the Material temperature and test temperature parameters, among others, from the delivery note to the Shipment document during O4G1 (change loading confirmation). We can only access until the Delivery Note, and then an automation in the system takes over, hence we cannot make changes in O4G1.
    What happens here now during O4G1 is the system does not look to the delivery note for whatever temperatures have been entered, but rather it looks back at the O3DEFAULTS table. The problem with that is, during the day, some temperature information can be updated, while O3DEFAULTS is updated perhaps only once a day.
    Is there a configuration setting that I can check?
    Thanks.

    Hi there,
    I do not think that there is standard way to copy additional quantities (Qty and temp data) from outbound delivery doc but I think you can do this thru custom developement like implementing BADI and add new tab "Qty in Alternate UoM" and get the data from LIPSO2 table. We have applied same approach on our TSW Nomination to display some additional data outside standard process.
    Hope this may help.
    Regards,
    RS

  • How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)?

    Hi,
    The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:-
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1904cddb-850c-4425-8205-998bfaad07d7/create-document-set-using-ecma-script
    But, when I am executing the code, I am getting error "Cannot read property 'DocumentSet' of undefined "..Please find
    below my code. I am using Content editor web part and attached my JS file with that :-
    <div>
    <label>Enter the DocumentSet Name <input type="text" id="txtGetDocumentSetName" name="DocumentSetname"/> </label> </br>
    <input type="button" id="btncreate" name="bcreateDocumentSet" value="Create Document Set" onclick="javascript:CreateDocumentSet()"/>
    </div>
    <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"> </script>
    <script type="text/javascript">
       SP.SOD.executeFunc('sp.js','SP.ClientContext','SP.DocumentSet','SP.DocumentManagement.js',CreateDocumentSet);
    // This function is called on click of the “Create Document Set” button. 
    var ctx;
    var parentFolder;
    var newDocSetName;
    var docsetContentType;
    function CreateDocumentSet() {
        alert("In ClientContext");
        var ctx = SP.ClientContext.get_current(); 
        newDocSetName = $('#txtGetDocumentSetName').val(); 
        var docSetContentTypeID = "0x0120D520";
        alert("docSetContentTypeID:=" + docSetContentTypeID);
        var web = ctx.get_web(); 
        var list = web.get_lists().getByTitle('Current Documents'); 
        ctx.load(list);
        alert("List Loaded !!");
        parentFolder = list.get_rootFolder(); 
        ctx.load(parentFolder);
        docsetContentType = web.get_contentTypes().getById(docSetContentTypeID); 
        ctx.load(docsetContentType);
        alert("docsetContentType Loaded !!");
        ctx.executeQueryAsync(onRequestSuccess, onRequestFail);
    function onRequestSuccess() {       
        alert("In Success");
        SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
        alert('Document Set creation successful');
    // This function runs if the executeQueryAsync call fails.
    function onRequestFail(sender, args) {
        alert("Document Set creation failed" + + args.get_message());
    Please help !!
    Vipul Jain

    Hello,
    I have already tried your solution, however in that case I get the error - "UncaughtSys.ArgumentNullException: Sys.ArgumentNullException:
    Value cannot be null.Parameter name: context"...
    Also, I tried removing SP.SOD.executeFunc
    from my code, but no success :(
    Kindly suggest !!!
    Vipul Jain

  • Document Set Creation in document library using REST API in Sharepoint 2013

    Hi,
    I want to create the document set using REST API call. Currently i am able to create the folder and able to upload the files using REST API's in the document library. Is there any way we can pass the contentype name or Id and create the document set using
    REST API call. We need to create the document set along with metadata and upload the files inside the document set.
    I need to create the document set along with meta data column values using REST API. Please let me know how we can achieve this through REST API.
    Thank you,
    Mylsamy

    Hi,
    According to your post, my understanding is that you wanted to create document set along with managed metadata fields.
    The REST API does not currently support working with Managed Metadata or Taxonomy fields.
    As a workaround, we can use the JavaScript Client Object Model.
    Create document set using JavaScript Client Object Model.
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/aacd96dc-0fb2-4f0d-ab4c-f94ce819e3ed/create-document-sets-with-javascript-com-sharepoint-2010
    Set managed metadata field with JavaScript Client Object Model.
    http://sharepoint.stackexchange.com/questions/95933/add-list-item-with-managed-metadata-field-through-jsom
    http://sharepointfieldnotes.blogspot.com/2013/06/sharepoint-2013-code-tips-setting.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Adding a custom report to a document set

    Hi,
    We are trying to add a custom report to a document set in OM. When a sales order is released, the sequence of events to occur is - a standard pick list report runs followed by the custom report(a despatch note).
    However, I cannot associate the parameters so that the parameters that are driving the standard apps pick list report are also driving the custom report.
    Anyone tried this before?
    Thanks muchly

    Eventually I figured this out. In 54, the edit dialog for the clickstream cloud is set up in the JS at:
         /libs/cq/personalization/widgets/source/analytics.init.js
    Effectively the 'registration' of the various stores is hardcoded in this JS file, with lines like so:
         //eventinfodata
         reg.call(this, CQ_Analytics.EventDataMgr);
    So, we could overlay the entire personalization widgets clientlib, but that seems crazy just to add one line of code.
    So, what I've done is to write my own clientlib and bolded it onto the cq.personalization category (which the /libs/cq/personalization/widgets clientlib is part of). This JS sets up another listener (on the click of the edit button) which adds the additional tab to the edit dialog.
    If anybody is interested in seeing how this was done, buzz me on twitter @tomblackford

  • Custom Master Page issue with Document Set Libraries

    Details: Publishing site using SharePoint 2013.  The SharePoint is on my company's servers.
    Have a custom Master page that has a navigation banner (built with HTML/CSS/javascript).  The site has it applied successfully to the "Site Master Page" but when I also apply it to the "System Master Page", the libraries that have
    Document Set type content do not show the files within.   We'd like to be successful in applying to the "System Master Page" as that allows the banner to show when an actual library is accessed.    Any suggestions, please?

    Thanks. I've been experimenting with this for a few days now, and there's lots I don't understand about why and such, but your process above works. That's a big load off me right now and I really appreciate it. I'm going to be able to survive the initial
    roll-out and implementation of the new site. Going forward, I've got lots to learn and find out, I've already heard that there's a desire to really redesign the master page for the site and subsites, way beyond the little CSS customization I did. Fun.
    If you've got a little time though, perhaps you can provide some explanation. If not, no problem.
    On step 6, when I do as you detail, click the System Master Page and reset all the subsites, it seems to work fine with my custom master page. If I do that with the Site Master Page settings, my custom page causes the redirect issue in the subsites again.
    This is whether I do the Site Master Page by itself, or in conjunction with the System Master Page settings. If I revert back to the Seattle master page in the Site Master Page settings and my custom pate in the System Master Page, the issue goes away again.
    It is completely messing with my head, trying to figure out why that would be, and this is all beside trying to figure out why adding the one little CSS reference to the Seattle master to create my master page breaks things (sometimes!).
    Just fyi, what I've ended up with for now is pulling my custom master page out of the system and using the Alternate CSS URL to add my custom CSS to the Seattle master page on the sites. As I thought about all this, I decided I didn't want to leave the breakable
    custom page out there for some unsuspecting site manager to accidentally pick and get everyone screaming about the broken sites.
    Thanks again,
    Steven

  • Content type (Audio) not appearing as choice for document properties in a document set

    We've created a document set for which there are currently 11 Content types. When we upload a document to the document set we have the following problems:
    one of the content types is not available (A customized Audio Content Type).
    we can't seem to set the order in which the content types appear in the list (incomplete though it is)
    we also can't set the default content type for uploaded documents.
    Is there a way to resolve these issues?
    Notes:
    Three are several document sets in the content hub but only one in the library where this content type is used.
    We're running SP2013
    Thanks in advance for your suggestions in resolving this.
    Barry Cohen
    Barry Cohen

    Hi Barry,
    Based on your description, my understanding is that the content type called Audio is not available when uploading a document to the document set.
    I recommend to check if the content type is added to the Allowed Site Types of the document set content type.
    Please follow the steps below:
    Make sure that the content type has been added to the library.
    In Library settings page of the library, click Document set content type under Content Types.
    Click Document Set settings under Settings.
    Check if the content type called Audio is included in the Content Types allowed in the Document Set. If not, please add it to the allowed content types.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • How to create a people picker type metadata in a document set?

    
    Hi folks,
    I want to create a people picker type metadata in a document
    set (it has some content types and it resides inside a library).
    So please help me knowing steps for creating it. 
    Our web application is using classic based authentication therefore I want to retrieve the names and groups in people picker column from Active Directory.
    Also, the document set library for which I want to create people picker metadata did not had document set before and documents where saved directly in content types as well as the metadata that now we are making as people picker was before of type Single line
    of text. 
    So, whether after creating it of type people picker, at the time of moving documents into document set, it will create problem? If yes,than of of what kind and how can it be resolved?
    Replies will be greatly appreciated.
    -Ishita

    Hi,
    From your description, I know you want to add a people picker column in a document set, then add this document set into a document library.
    If you want to add a people picker column in a document set you should create a document set first. You can know how to create and configure a document set by referring to this article: https://support.office.com/en-us/article/Create-and-configure-a-new-Document-Set-content-type-9db6d6dc-c23a-4dcd-a359-3e4bbbc47fc1.
    After creating a document set, you can follow these steps below to add a people picker column in a document set: click Site Actions -> Site Settings -> under  Galleries section, Site content types -> find the content you want to add people
    picker column -> under Columns section, Add from new site column -> Name and Type, enter your column name and choice Person or Group -> OK.
    If you move documents into document set, it will keep the current properties. You can edit properties to change the document to another content type which is  contained in the document set.
    In my case, DocA is the content type of the document library, Document and DocB are content types of the document set.
    If I have mis-understand, please let me know.
    Best Regards

  • Create Document Set with custom Create Only permission set

    Here is the situation. We have a requirement where my customer wants to create document sets, however, document set/document level permissions are required.
    Setup: We created a new permission level called "Create Only". We then give the user Read and Create only permissions. This allows the user to theoretically create the item. We then run a Workflow on create that Replaces the permissions so that
    you are only allowed to view the ones you created along with other security groups based on their choices in the metadata fields.
    This setup works PERFECTLY when using a List or Form Library.
    However, for the life of me I cannot get it to work for Document Sets. If I have the same setup, I get an Access Denied message. However, it still creates the document set.
    What is weird, I've been playing around with custom permission levels and it seems as though the user has to have EDIT permissions at a minimum in order to create the document set. This will not work for me since I dynamically assign permissions to each
    document set based on what they select.
    As a side note, the only tool I have at my disposal is SharePoint Designer 2010.
    Does anyone know if there is an actual requirement to have EDIT permissions when creating a Document Set? Any input would be greatly appreciated.
    Alternatively, is there a way to setup permissions on a library for all NT Authenticated users so that we can give them the necessary permissions to create the Document Set, but still prevent them from see the other items and then the Workflow would set
    the permissions accordingly?
    I believe the more granular the permissions it uses those permissions instead so would this work?  I have not tested this theory yet.

    Hi,
    According to your description, my understanding is that you want to know if there is an actual requirement to have EDIT permissions when creating a Document Set and is there a way to setup permissions on a library for all NT Authenticated users and prevent
    them from seeing items created by others.
    For the first question, per my knowledge, if a user is given the Add Items permission, he/she can create a document set in SharePoint.
    However, there is an error “access denied” after the document set is created. It is due to the user has no permission to access the page which SharePoint will redirect the user to after finishing creating the document set.
    If the user is also given Edit Items permission, there will be no error when he/she create a document set.
    For the second question, I recommend to follow the link below to
    customize item permissions for each document submitted to a document library and remember to give the
    NT Authenticated users contribute permission.
    http://blogs.technet.com/b/spke/archive/2010/04/09/configure-item-level-permissions-for-document-libraries-sharepoint-2010-edition.aspx
    To grant permission to NT Authenticated users, please refer to the link below:
    http://office.microsoft.com/en-in/sharepoint-server-help/what-happened-to-add-all-authenticated-users-HA101805183.aspx
    Best regards.
    Thanks
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Document Set shared columns not propagated to documents newly added

    I have a Document Set with shared Managed Metadata and Person fields.
    I have found that sometimes some managed metadata fields are not propagated to newly added documents using drag and drop with Windows Explorer.
    [ Note : Sharepoint 2013 with SP1 ]
    Example
    Field A = Person or group (optional)
    Field B = Managed Metadata (optional)
    Step 1 :
    I create a new Document Set (lets call this one docset X), with field A empty and field B with a value.
    I save this docset then open the document library in Windows Explorer and finaly, drag and drop a document inside the folder of this newly created docset.
    When I look at the properties of the document, I found that there is no value in the field B even if it's not the case of the docset.
    Step 2 :
    I create another Document Set (lets call this one docset Z), and add a value inside field A and field B.
    Again, I save this docset then open the document library in Windows Explorer and finaly, drag and drop a document inside the folder of this newly created docset.
    When I look at the properties of the document, I found that there is a value in the field B and in the field A.
    Conclusion
    So it seems that the propagation of field B depends on if there is a value inside field A.
    It does not make sense.
    Any ideas ?

    Hi vinz,
    I tried many times and couldn't reproduce your issue in my environment(SP 2013+SP1), manged metadata field value in Docuemnt Set content item always could be propagated to documents dragged/dropped in this doc set folder via Windows Explorer regarding
    other fields value.
    You may try to test on other lists, site collections or web applications (may also test with new manged metada term store), see if this issue could be reproduced or isolate, the manged metada column value shouldn't be depend on other column value.
    Also check ULS log, see if there is any related error message generated when the document is dragged to the library windows explorer with this issue.
    http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
    Thanks
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Document Set name as refiner in Search results?

    I'm wondering if there is a way to use the document set name as a refiner in a search results page so a user can search a specific site or document library and choose the document set name to narrow the results? Initially I thought I could create a
    shared column on the document set (in the properties of the document set type itself) which looked up or calculated the document set name and then this would be shared with the documents within the set. I couldn't find a way to get the name of the set.
    What would be the best way (if any), of getting the search results or document properties themselves (if I created a column which contained the document set name for e.g.) to show the document set (if populated) that the document belongs to?
    Document Library
    Document 1
    Document 2
    Document Set A
         Document A1
         Document A2
    Document Set B
         Document B1
    How can I get search results to show a refiner on Document A1 and A2 indicating they're in the same Document Set A? I realise I need crawled/managed property but how best should I set this up?
    If this is not possible can anyone suggest an alternative please?
    Many thanks!
    Scott

    Hi,
    I am afraid that there is no existing managed properties on the document which we can count on to know which document sets the document belongs to.  Just like what you said "created a column which contained the document set name", this could
    be a workaround to achieve what you want.
    To do that:
    1. Add a new site column named DocumentSetName and add it to
    DocumentSet Content Type. And give value "DocumentSet_A" for document set A and "DocumentSet_B" for document set B.
    2. In the Document Set settings, enable the newly added column as
    Shared Columns. It means that all documents added to this document set will share the column and its value.
    3. Reindex this document library.
    4. In the Search Results refiner, add the automatically created Managed Property
    as Refiner. 
    With this method, you can filter the documents with the name of document sets when searching office documents in search center. The only information you need input manually is Value of the site column.
    http://blogs.technet.com/b/sharepoint_made_easy/archive/2013/03/19/step-by-step-configuration-to-add-custom-refiners-in-the-refinement-panel-of-search-results-page-for-sharepoint-online.aspx
    Moreover, if you have the requirement to create batch of DocumentSets without any manual input, you can refer to the following link which explain how to create them with proper settings and default values.
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    Miles LI TechNet Community Support

  • Workflow for Document Set

    I am trying to develop an e-mail notification on a Document Set - problem is the workflow triggers not only on the document set, but all the documents within the set.
    I know I can't start the workflow "when a document is created" - has anyone found a solution so the workflow is only triggered when the document set is created (and not again when individual documents are uploaded)
    Cindi

    There are a couple of options that I can think of.
    Firstly you could create a Resuable Workflow that is associated with the Document Set Content Type. Although in this instance I would probably look to create a new Content Type (let's say I call it MyCustomDocumentSet) with a Parent of Document Set
    and set the Resuable Workflow to be based on MyCustomDocumentSet Content Type. Then associate the MyCustomDocumentSet with your List instead of the Document Set Content Type.
    After you have created the Workflow you would need to go back into your MyCustomDocumentSet Content Type and set the Workflow to start on When an item is created.
    The second option (perhaps not so elegant, but easy to set up and will work) is to have a normal List Workflow that fires for the Document Set and Documents within it, but have a condition to check what is being created. For example:
    If CurrentItem:ContentType not equals Document Set
    Stop the workflow and log "My Message"
    If it isn't a Document Set then the workflow will stop. However, if it is a Document Set it will continue with whatever you add to your workflow after the condition and stop workflow action.

Maybe you are looking for