SharePoint Designer workflow: Move a document from one library to another

Learn how you can create a SharePoint Designer 2007 workflow that can be manually started on a document to move that document from the SharePoint document library in which it is currently located to another document library on the same SharePoint site.

ADVERTISEMENTS

Scenario

You have a document on which you want to start a workflow that will move the document from one document library to another.

Solution

Moving a document using a SharePoint Designer workflow involves copying the document to the SharePoint document library you want to move the document to, and then deleting the document from the current document library it is in.

You can use the Copy List Item action to copy the document and the Delete item action to delete the document.

To create a SharePoint Designer workflow that can move a document from one document library to another:

  1. In SharePoint Designer 2007, open the SharePoint site on which the document library that contains the documents to move is located, and create a new SharePoint Designer workflow.
  2. On the Define your new workflow screen of the Workflow Designer, enter a name for the workflow, select the document library you want to attach the workflow to (this would be a document library containing documents to move), select Allow this workflow to be manually started from an item, and click Next.
  3. On the Step 1 screen of the Workflow Designer, click Actions, and then click More Actions from the drop-down menu.
  4. On the Workflow Actions dialog box, select List Actions from the category drop-down list box, select Copy List Item from the actions list, and click Add. The following text is added to the Workflow Designer:

    Copy item in this list to this list

  5. On the Step 1 screen of the Workflow Designer, click the first this list (representing the document library to copy the document from) in the text of the Copy List Item action.
  6. On the Choose List Item dialog box, leave Current Item selected, and click OK.
  7. On the Step 1 screen of the Workflow Designer, click the second this list (representing the document library to copy the document to) in the text of the Copy List Item action, and select the document library (this is the document library to where you want to move the document) from the drop-down list box that appears.
  8. On the Step 1 screen of the Workflow Designer, click Actions, and then click More Actions from the drop-down menu.
  9. On the Workflow Actions dialog box, select List Actions from the category drop-down list box, select Delete Item from the actions list, and click Add. The following text is added to the Workflow Designer:

    then Delete item in this list

  10. On the Step 1 screen of the Workflow Designer, click this list in the text of the Delete Item action.
  11. On the Choose List Item dialog box, leave Current Item selected and click OK. The final text for the workflow should now look like:

    Copy item in DocLib1 to DocLib2
      then Delete item in DocLib1

    where DocLib1 is the SharePoint document library containing the document to move and DocLib2 the document library to move the document to.

  12. On the Step 1 screen of the Workflow Designer, click Finish.

Testing the workflow

  1. Go to the SharePoint document library to which you attached the workflow, click on a document, and select Workflows from the drop-down menu.
  2. On the Workflows page, click the name of your SharePoint Designer workflow.
  3. On the workflow initiation page, click Start.

When the workflow completes, the document should have moved from the first SharePoint document library to the second document library.

Related Articles

ADVERTISEMENTS