none
automatic folder generation in sharepoint based on workflow

    Question

  • Hi together,

    we are using the enterprise version of share point 2010 and have the following requirement:

    We have a row of libraries where folders are created. The idea is that when a user creates a folder in a library, that some subfolders shall be generated automatically generated. 

    Ideally we should be able to somehow assign different permission levels to the subfolders based on groups defined in share point.

    My question is:

    • How can this be done, either with the API, or maybe even easier with a workflow that runs once a new library element is created.

    Thanks

    Matthias

    Friday, September 28, 2012 4:03 PM

Answers

  • Hi whdde,

    We can use following workflows to create subfolders. This workflow can only work to create subfolders when new folder is created on top level.

    Suppose your document library is named “docA” and the URL of your document library is: http://server/sitename/doc1A. And we need another custom list as an assistant list, let’s name it “listB”.

    First workflow created on your document library which you want to create subfolder automatically. Set workflow start when new item is created.

    If Current Item: Content Type ID equals Folder,
    and Current Item:Path equal /sitename/docA,
    Create item in listB. (Set Title field = Current Item: URL Path)

    Second workflow created for listB. Also set to start when new item is created.

    Create item in docA.
    (Set
    Path and Name = [%Current Item:Title%]/newfoldername,
    comments = “newfolder”
    Content Type ID = “Folder”)

    Done and test when new folder on top level of docA is created, will a new subfolder named “newfoldername” be created under the new folder.

    And we can use Impersonation step to modify folder’s permission in SharePoint Designer workflow.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    Monday, October 01, 2012 9:46 AM

All replies

  • Hi

    Schedule a powershell script which will create folders with propper rights


    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.

    Monday, October 01, 2012 5:26 AM
  • Hi whdde,

    We can use following workflows to create subfolders. This workflow can only work to create subfolders when new folder is created on top level.

    Suppose your document library is named “docA” and the URL of your document library is: http://server/sitename/doc1A. And we need another custom list as an assistant list, let’s name it “listB”.

    First workflow created on your document library which you want to create subfolder automatically. Set workflow start when new item is created.

    If Current Item: Content Type ID equals Folder,
    and Current Item:Path equal /sitename/docA,
    Create item in listB. (Set Title field = Current Item: URL Path)

    Second workflow created for listB. Also set to start when new item is created.

    Create item in docA.
    (Set
    Path and Name = [%Current Item:Title%]/newfoldername,
    comments = “newfolder”
    Content Type ID = “Folder”)

    Done and test when new folder on top level of docA is created, will a new subfolder named “newfoldername” be created under the new folder.

    And we can use Impersonation step to modify folder’s permission in SharePoint Designer workflow.

    Thanks & Regards,
    Emir


    Emir Liu

    TechNet Community Support

    Monday, October 01, 2012 9:46 AM