Workflow Soluiton

 View Only
  • 1.  Dynamically Creating Folders in Sharepoint

    Posted Aug 27, 2009 01:06 PM
    I was wondering if anyone has been able to dynamically create folders under a document library in Sharepoint? I created a web service integrator to the Sharepoint web services and tried using the CreateFolder webservice but have been unsuccessful so far with path does not exist and no instance of an object errors. Ideally I would like to create a directory and then copy/move a file there. We are currently using Sharepoint 2003.

    Thanks,

    Aryanos


  • 2.  RE: Dynamically Creating Folders in Sharepoint
    Best Answer

    Posted Sep 08, 2009 01:28 PM
    Hi Aryanos,

    Yes I have. Working with Webservices in Workflow is probably my favorite functionality in Workflow because of the ease.

    You must remember the following to create the folder in Sharepoint:

    1. Create a Webservice integration to the DWS.asmx in the site you want to use. For example, root documents would be: http://sharepointurl/Sharepoint/_vti_bin/dws.asmx. This will enable dws to control documents in the Sharepoint folder. If it is a subsite you would use something like http://sharepointurl/Sharepoint/NewSite/_vti_bin/dws.asmx. You can not use the dws.asmx in the root bin to create folders in the NewSite documents folder.

    2. There can be no spaces in the url path. Replace spaces with %20.

    3. The URL must be relative in relation to the _vti_bin home folder. For example, to create a folder in the document library http://sharepointurl/Sharepoint/NewSite/Test Documents/ called Test1 you would use the following URL to the Dws.asmx:

      http://sharepointurl/Sharepoint/NewSite/_vti_bin/dws.asmx

    and the following URL:
    Test%20Documents/Test1

    It is generally easier to avoid spaces completely.

    In addition, using the root _vti_bin will create the folder in the root documents.

    I hope this helps.

    Thanks.



  • 3.  RE: Dynamically Creating Folders in Sharepoint

    Posted Sep 08, 2009 07:07 PM
    Thanks for the steps. I was able to create folders using the CreateFolderComponent. Can you also please provide an example on how to use the CreatedDwsComponent as well? Also, would you know how to move/copy a file into the newly created folder? At the end of my workflow I create a PDF file and would like to store it under that folder. I tried using a WriteFile component but you can't specify the path to the Sharepoint folder. Thanks a lot for the help.


  • 4.  RE: Dynamically Creating Folders in Sharepoint

    Posted Nov 30, 2009 05:26 PM
    Aryanos, did you find a way to write a file into that folder?  I'm having the same problem.


  • 5.  RE: Dynamically Creating Folders in Sharepoint

    Posted Dec 01, 2009 01:11 PM
    I haven't found a way to do it yet but doing some googling it looks like we may need to create our own web service to do this. I haven't looked at this for a while but will probably get back to it later this month or early next month. I'll let you know if I make any progress and if you find a way to do this in the meantime, please let me know.