Iterate through documents in a Document Set

Document created by Brad Orluk Employee on May 19, 2016
Version 1Show Document
  • View in full screen mode

This workflow will loop through documents inside of a document set. Practical applications of this workflow include notifications on contents of the docset, approval roll ups, bulk document movement, etc.

 

AuthorBrad Orluk
Long Description

So, I’m a big fan of working with metadata (SharePoint views FTW!) instead of logical hierarchies (folders = boo!) and, on several occasions, I have found myself needing to run an action (a review task or approval perhaps) against all of the documents inside of a SharePoint Document Set.   But when I navigate to the Document Set I encounter a long and somewhat ugly URL for the set itself and begin the tedious work of recording the URL’s for each document.

So how can I quickly retrieve all of the document URL’s?    Enter Nintex Workflow, a few action configurations and voilà!

Dependencies

N/A

Support Info

Iterate through documents in a Document Set | Brad’s Blatherskite Blog

Compatibility

Nintex Workflow 2010

Nintex Workflow 2013

Platform

SharePoint Server 2010

SharePoint Server 2013

Screenshots

Our Document Library (Doc Lib A in this case), which has been configured with a Document Set content type, and our first Document Set (Test Document Set A).  For realism, I’ve sprinkled it with a few Word documents, with fascinating names (such as the timeless, Test Doc 1-4!).

Then we open the Nintex Workflow Designer and create a new workflow…

For this exercise I will simply be recording each items URL in the workflow history. But, you could use your imagination here… Another scenario with the URL’s would be populating an email notification where users would need to review a document based on its metadata. Another could be that each document in the set would need to be copied to another location for a publishing or retention process, so we would need to collect its location for additional workflow actions.

Building the Workflow

First, we need to create some variables to store our data:

  • textDocSetRaw – A text variable to store each documents Context Item URL.
  • textDocSetName – A text variable to store the isolated and cleaned up Document Set name.
  • colDocument – A collection to store the list of all of the documents inside of the set.
  • textDocumentUrl – A text variable to store each documents URL.

Then we build out the workflow to perform the following tasks:

  1. Extract the Document Set Name
  2. Remove the %20’s in the name and replace them with spaces
  3. Remove the open in browser string
  4. Query our library for all of the documents in the particular set
  5. Record the URL for each document in the workflow history of the Document Set

DocSet32414

Outcome

DocSet324142

Additional Information

We can now run this workflow against a specific Document Set and it will return the URL for each document inside. This is a handy tool for my SP bag. Maybe yours now?

Nintex Xchange Terms of Use Policy

Nintex makes no warranty or guarantee about the reliability, performance, quality, or functionality of any assets, and any assets you install are therefore provided as is. By downloading this asset, you agree to the terms of use.

1 person found this helpful

Outcomes