Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Dynamically Creating Folders in Sharepoint

Updated: 22 May 2010 | 4 comments
Aryanos's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

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

discussion Filed Under:

Comments

TSASnowJGJ's picture
08
Sep
2009
2 Votes +2
Login to vote

Very Easy

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.

Aryanos's picture
08
Sep
2009
0 Votes 0
Login to vote

Thanks TSASnowJGJ

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.

I like my beats fast and my bass down low

DrGonzo65's picture
30
Nov
2009
0 Votes 0
Login to vote

Any luck uploading that file to the folder?

Aryanos, did you find a way to write a file into that folder?  I'm having the same problem.

Aryanos's picture
01
Dec
2009
0 Votes 0
Login to vote

Not yet

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.

I like my beats fast and my bass down low