sharepoint workflow to move files of a content type to new folder (after creating it if needed)

1.8k views Asked by At

I have multiple SP document libraries for different meetings. I want to keep the libraries organized by meeting day. So each meeting would have it's own folder and all the files for that day would go in that folder.

To make it easy I wanted to make it so you can upload a file and then a SP workflow will create a folder for that meeting, if needed, and move the file.

So I created a "meeting file" content type that also gets meeting date and file type (minutes, presentation, misc, etc...)...

What I need to do next is check if a folder for that meeting date exists and create it if it does not. Then move the file over to that folder.

Any ideas how I could do this?

I could also try it without using content types but then the workflow starts automatically for every file added and then I cannot create a new folder with that workflow (because it would start a new instance of that workflow).

I was hoping to keep it reusable so I could just use one workflow for all the document libraries. I thought the workflow could find the path of the list it is being run on, and create the folders and do the other work within that list.

Any ideas are appreciated.

1

There are 1 answers

4
Sebastian 506563 On BEST ANSWER

For creating folder via workflows:

Creating folders and sub-folders using SharePoint 2010 Designer Workflow

and for checking folder name:

  1. Create a string workflow variable.
  2. Now create a lookup for your folder and set the variable to the folder's title. Take a look here for some helpful information and usage guidelines when it comes to list folders.
  3. The actions dependent of the existence of the folder have to be placed inside an if-statement
  4. E.g. the if-statement should be like "if [variable] not equals [folder name]" if you want the actions only to be run when the folder does not exist

and here the whole tutorial that I found:

Create folders using a SPD workflow