Monday, June 15, 2015

Nintex: Make Dynamic Link to Filtered View of Library

  1. A user enters a project request in a custom list (Project List).  A workflow goes through an approval process, then when it is approved (a column value set by the workflow), a group of documents is copied from a Template Library to the Active Project Documents library, where the documents will be worked on.  T
  2. In the Active Project Documents library, one meta data column will be set by the workflow:  Project Name
  3. The Project List will have a link to the Active Project Documents Library - a filtered view that shows only the items with the project in question. 
Workflow Steps
There are multiple ways to accomplish the goals, but this is the way I found in my environment.  This workflow kicks off after the project approval process.

Before getting started, create a variable called URLToProjLib.  Make it a string.
Make sure you have a column in this Library of type URL, as well as a Project Name field - type single line of text.
  1. Update Multiple Items 
    • This step updates a field called "Project Name" in the template library.   This is in preparation to copy the item to Active Projects with the right meta data
  2.  Copy Item
    • In this case, I want to copy an item from the Template Library to the Project Library when the document type (a meta data column available in both libraries) is equal to Project Plan. 
  3.  Update Multiple Items
    • I do the same as step one, except I fill in the value "none" in the Project Name field.  This step isn't needed to make this workflow work.  It just cleans things up in a way that is appealing.
  4.  Regular Expression
    • The goal of this step is to replace any spaces in the Project Name field with the characters "%2520".  This is how it would look in the URL for the filtered view.
    • Pattern: \s
    • Operation: Replace text
    • Replacement text: %2520
    • Input text: Insert reference to Project Name column
    • Store result in the variable you created earlier: URLToProjLib.
  5. Build String
    •  This step builds a string that will fill in a field of type URL.  To do that, you have to have this pattern - http://url, display.  The url, a comma, then the display name.
    • Get URL to your document library filter.  To do that, go to the library, filter on the column you want.  Copy the URL.  Example: http://sharepoint/sites/nintex/Project%20Library/Forms/AllItems.aspx#InplviewHasha9c67577-f3ef-4416-baf4-50d33aca4de7=FilterField1%3DProject%255Fx0020%255FName-FilterValue1%3DUpgrade%2520project
    • In this example, the field project name is being filtered on. The highlighted text is the value being filtered.  Copy everything but the highlighted text into the Text space in the Build String editor.  Example shown in red below.
    • Add the URLToProjLib variable (in blue below), then a comma, a space, then a reference the the Project Name column (n orange below).
    • Text - http://mysharepoint/sites/nintex/Project%20Library/Forms/AllItems.aspx#InplviewHasha9c67577-f3ef-4416-baf4-50d33aca4de7=FilterField1%3DProject%255Fx0020%255FName-FilterValue1%3D{WorkflowVariable:URLToProjLib}, {ItemProperty:Project_x0020_Name}
    • Store the result in the URLToProjLib (it will overwrite the previous value)
  6. Set Field Value
    • Set the value of Project Documents (your URL column) equal to workflow data.  Choose the URLToProjLib.  Then, click the ellipsis next to the drop-down and choose Plain Text for the return type.

No comments:

Post a Comment