Nintex workflow to Merge all the documents to PDF in a Document Library

In one of my recent projects, there was a requirement of Merging all the documents in a document library to a single PDF using Nintex workflow.

If you have been following my blog you might have already come across the Microsoft Flow Merge article, but for this particular customer, it had to be Nintex On-Premise workflow because they just loved ❤ Nintex and they did not have Microsoft Flow on-premise connector configured.

Please follow the instructions below or download the complete workflow in NWF format.

Final.jpg                                                                       The Finished workflow

Prerequisites

  1. Make sure the PDF Converter for SharePoint is installed.
  2. Naturally, Nintex Workflow will need to be installed as well. Nintex Workflow version 2007, 2010 2013 and 2016 are supported.
  3. The user (you) will need to have the appropriate privileges to create workflows.

So now that we have all the Prerequisites in place, let’s start building our Nintex Merge Workflow.

Step 1:

  • Open the SharePoint Document Library that you want to attach the workflow to.
  • In the Library ribbon, select Workflow Settings and click on Create a Workflow in Nintex Workflow.

Create a Workflow Nintex.jpg

Step 2:

  • On the Nintex Workflow Designer Click on Workflow Settings and click on Variables.

Variables.jpg

Step 3:

  • Add the variables with reference to the screenshot below.

Variablesreference.jpg

Step 4:

  • Drag a Query list workflow action onto the design canvas. Double-click the Query list action to open the configuration dialog.
  • In the *List field select the document library.
  • In the *Field select “Server Relative URL” click on Add and set it to “DocumentCollection Variable”.
  • Check the “Recursive” checkbox.
  • Click the General tab and then Save.

Querylist.jpg

Step 5:

  • Drag a For each workflow action onto the design canvas. Double-click the For each action to open the configuration dialog.
  • Set the “Target collection”  field to “DocumentCollection” variable and “Store result in” to “DocumentURLs” variable.
  • Click the General tab and then Save.

Foreach.jpg

Step 6:

  • Drag a Build sting workflow action onto the design canvas. Double-click the For each action to open the configuration dialog.
  • Click the Insert Reference icon and Add the Workflow Variables  “DocumentURLS” and “MergeList” in the Text Field and set the “Store result in” field to “Mergelist“.
  • Click the General tab and then Save.

BuildStriing.jpg

Step 7:

  • Drag a “Merge file to PDF” workflow action onto the design canvas. Double-click the Merge file to PDF action to open the configuration dialog and configure it with reference to instructions/screenshot below.

Merge to PDF.jpg

Destination Path: Enter the path to write the merged file to, either:

  • Leave it empty to use the same filename (and path) as the file that triggered the workflow.
  • A relative path to a subsite/document library/folder, e.g. Shared Documents/Some Folder/Some File.pdf.
  • An absolute path to a different site collection, e.g. /sites/Finance/Shared Documents/Some Folder/Some File.pdf.

Source Files: Add the WorkflowVariable Merge list.


PDF List ID: If you wish to carry out further actions on the generated PDF file, e.g. merge additional documents or perform a check-in, then you can optionally write the ID of the List the PDF was written to in a workflow variable of type String.


PDF List Item ID: Similarly to PDF List ID, the Item ID of the generated PDF file can optionally be written to a workflow variable of type Item ID (in SharePoint 2007) or Integer (in newer SharePoint versions)

For more details about the Muhimbi Merge Workflow action, see : http://blog.muhimbi.com/2011/08/convert-and-merge-pdfs-using-nintex.html

Step 8:

  • In the Nintex Workflow ribbon, click Save and then click Publish and Submit.

Publish

Step 9:

  • Access the Workflows page for the list item: Click More options (), click Advanced, and then click Workflows.
  • The Workflows page lists published site workflows that are available for manual initiation.
  • Under Start, a New Workflow, click on the workflow we created.
  • The Start Workflow page appears with a preview of the selected workflow.
  • Click Start.

Startworkflow.jpg

All Done… Happy Converting. 😀

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s