<<

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Topic: Creating an Auto-Number Using Nintex Workflow Category: Tools and Objects User Level: Member (Coordinator) Prerequisite: How Do I … Create Lists within ProjectSolveSP? How Do I … Add a Nintex Workflow to a ProjectSolveSP Library? Overview One of the features missing in ProjectSolveSP that was available in ProjectSolve2 is the automatically generated number (auto-number) that was available to users with the ProjectSolve2 object.

While ProjectSolveSP lists and libraries do have an ID number feature out of the box, it automatically starts at “1” and increments numerically. Additionally, if you a file from that list or library, the ID number that had been assigned to that item is gone for good.

To fix this issue, the process outlined within this document uses a source number list and the Nintex Workflow for SharePoint application to create a customized auto-number that can be added to uniquely identify items within any list or library. This approach allowed us not only to automatically assign identification numbers to entries within a list or library, but to also reset those numbers as needed when test data is removed. Scenario For this lesson, we are going to create a document library where each entry into that library is assigned a unique ID number that reflects the name of the project.

The name of our project will be “Bridge ABC” and the ID number for each document will be “ABC-xxxx” (where “xxxx” will be “0001” thru “9999” as needed.) Steps Create the Number Source List The first thing we will do is to create a new list called “Master Numbers” and use this to establish the current source number for our workflow. Create the List To create our “Master Numbers” list:

1. Access the ProjectSolveSP site where we will be working. 2. Click the “Settings” button ( ). 3. Click the “Add an App” link on the Settings menu. 4. Click the “Custom List” icon. 5. Set the name to “MstrNums” (remember this name becomes part of the URL, so keep it short but descriptive, and then expand it once the list is made.) 6. Click the “Create” button.

The list is now available for use. Modify the Master Number List 1. Access the new “MstrNums” list. 2. Click the “List” tab. 3. Click the “List Settings” button.

How Do I… Create an Auto-Number using Nintex Workflow 1 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Reset the Name of the List 4. Click the “List Name, Description and Navigation” link:

Figure 1 - The "List Name, Description and Navigation" Link

5. Change the “Name” field from “MstrNums” to “Master Numbers”. 6. Leave the “Display this list on the Quick Launch?” set to “No” 7. Click “Save” to return to the settings page. Create the “Source Number” Column 8. Click “Create Column” in the “Columns” area:

Figure 2 - The "Create Column" Option

9. Set the Column Name to “Source Number.” 10. Set the Column Type to “Number” (Figure 3):

How Do I… Create an Auto-Number using Nintex Workflow 2 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 3 - The "Configure Column" Screen

11. Click “OK” to complete the process.

How Do I… Create an Auto-Number using Nintex Workflow 3 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Create the Seed Entry Once the list is ready we need to create a seed entry that will be used by the workflow.

1. Access the “Master Numbers” list. 2. Click “New Item.” 3. Name your item “Master Record.” 4. Set the “Source Number” to “1.” 5. Click “Save.”

Your “Master Numbers” list should now look similar to:

Figure 4 - The Populated "Master Numbers" List Add the Auto-Number Field to the Document Library If you have an existing document library you can use that or you can use the process shown in 1.1 above to create a new one. Add the Auto-number Field to the Document Library For our example we are going to create a new field called “Item #” that will be used to number the documents within the library.

1. Click the “Library” tab. 2. Click the “Library Settings” button. 3. Click the “Create Column” link. 4. Set the Column Name to “Item #.” 5. Set the Column Type to “Single line of text” (similar to Figure 5):

Figure 5 - The "Name and Type" Area

We are now ready to create our workflow.

How Do I… Create an Auto-Number using Nintex Workflow 4 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Create the Auto-Number Workflow We will create our workflow from the document library where we just created the “Item #” field.

1. Access the Document Library. 2. Click the “Library” tab. 3. Open the “Workflow Settings” menu. 4. Click the “Create a Workflow in Nintex Workflow” link:

Figure 6 - The "Create a Workflow in Nintex Workflow" Link

5. Click the “Blank” icon within the “Select a Workflow Template” screen:

Figure 7 - The 'Blank" Workflow Icon

6. Click the “Create” button. 7. The Nintex Workspace will then appear for you to work in (Figure 8):

How Do I… Create an Auto-Number using Nintex Workflow 5 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 8 - The Nintex Workspace

Configure the Workflow We will be using the following actions to create our workflow:

 Get the Source Number from the Master List (“Query List” Action)  Pad left the Source Number with Leading Zeros (“Set Variable” Action)  Prefix the Padded Source Number with ABC_ (“Build String” Action)  Set the Item # to the Prefixed Padded Source Number (“Set Field Value” Action)  Increment the Source Number (“Math Operation” Action)  Update the Master List with the Source Number Plus 1 (“Update Item” Action)

Once these have been deployed, we should see something similar to Figure 9.

How Do I… Create an Auto-Number using Nintex Workflow 6 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 9 - The Basic "Auto-Number" Workflow

Note: To make this workflow easier to use, it is highly recommended that you update the names of each action (by clicking on it and renaming it) to reflect the activity it will be performing. You should now see a workflow similar to Figure 10.

How Do I… Create an Auto-Number using Nintex Workflow 7 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 10 - The Renamed Basic "Auto-Number" Workflow How Do I… Create an Auto-Number using Nintex Workflow 8 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Configure “Get the Source Number from the Master List” The first thing we need the workflow to do is grab the current number from the Master list and put it into a variable that we can work with.

Figure 11 - The "Get the Source Number from the Master List" Action

Create the Variable To create our new variable:

1. Double-click on the action icon to open it in configuration mode. 2. Click the “Variables” icon to access the “Variables” screen:

Figure 12 - The "Workflow Variables" Selection Icon

3. Once the “Workflow Variables” screen appears, click the “New” button:

Figure 13 - The "New" Workflow Variable Button

4. Set the Name to “nextNumber.” 5. Set the Type to “Number.” 6. The screen should now look similar to Figure 14.

How Do I… Create an Auto-Number using Nintex Workflow 9 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 14 - The Populated "nextNumber" Variable Screen

7. Click “Save” to create this workflow variable. 8. You will be returned to the “Configure Action” screen.

Configure the Action Once we have created our variable, we can configure the workflow to use that variable to store the number from the Master list in.

From the Configure Action screen:

1. Set “Editor Mode” to “Query Builder.” 2. Set “List” to the “Master Numbers” List. 3. Set the “Filter” to “Select all list items.” 4. Set “Field” to “Source Number” and then click the “Add” button. 5. Set “Source Number” field to equal our new variable set above:

How Do I… Create an Auto-Number using Nintex Workflow 10 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 15 - The Updated "Configure Action" Screen

6. Click “Save” to save the configuration update. Configure “Pad left the Source Number with Leading Zeros” The next thing we need to do is left pad our number so that instead of “1” or “2”, it will display as “0001” or “0002.”

Figure 16 - The "Pad left the Source Number with Leading Zeros" Action

Create the Variable We need to create a variable for containing the padded number for use later in the workflow. To do this, we will create a new variable called “prefixedNextNumber” and set the type to “Single line of text”, similar to Figure 17.

How Do I… Create an Auto-Number using Nintex Workflow 11 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 17 - The "prefixedNextNumber" Variable

Configure the Action Once we have our variable, we can configure our action to utilize it.

1. Under “Set” select the variable we just created. 2. Set “Equals” to “Value.” 3. Click the “Insert Reference” button:

Figure 18 - The "Insert Reference" Button

4. On the “Insert Reference” screen, click the “Inline Functions” tab. 5. Double-click “PadLeft” and “fn-PadLeft()” will appear in the “Dynamic text to insert” box: How Do I… Create an Auto-Number using Nintex Workflow 12 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 19 - Selecting Inline Function "PadLeft"

6. Click between the left and right parenthesis to place your there. 7. Click the “Workflow Variables” tab. 8. Double-click the “nextNumber” variable we created earlier and it will appear between the parenthesis. 9. Place the cursor between “nextNumber” and “)” and type in “,4,0”

How Do I… Create an Auto-Number using Nintex Workflow 13 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

10. The screen should now look like Figure 20:

Figure 20 - The Updated "Insert Reference" Screen

11. Click “OK” to return to the Configure Action screen, which should now look like Figure 21.

Figure 21 - The Updated Configure Action Screen

12. Click “Save” to continue.

How Do I… Create an Auto-Number using Nintex Workflow 14 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Configure “Prefix the Padded Source Number with ABC_” Next we will create our prefix we wish to use with the customized auto-numbers. For our example, we will prefix all numbers with “ABC_”.

Figure 22 - The "Prefix the Padded Source Number with ABC_" Action

Configure the Action To configure this action:

1. Double-click on the action icon to open it in configuration mode. 2. Type “ABC_” in the “Text” box. 3. Click the “Insert Reference” icon (Figure 23):

Figure 23 - The "Insert Reference" Icon

4. Click the “Workflow Variables” tab. 5. Double-click the “prefixedNextNumber” variable to add it to the “Dynamic text to insert” area (Figure 24).

How Do I… Create an Auto-Number using Nintex Workflow 15 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 24 - The Updated "Dynamic Text to Insert" Area

6. Click “OK” to return to the “Configure Action” screen. 7. The “Text” box should now look like Figure 25:

How Do I… Create an Auto-Number using Nintex Workflow 16 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 25 - The Updated "Text" Box

8. Click “Save” to return to the Workflow screen. Configure “Set the Item # to the Prefixed Padded Source Number” Now that we have created our configured number, we need to update the Document Library’s “Item #” field with that new number format.

Figure 26 - The "Set the Item # to the Prefixed Padded Source Number" Action

Configure the Action To configure the action:

1. Double-click the “Set the Item # to the Prefixed Padded Source Number” action. 2. Select “Item #” from the list for “Set.” 3. Set “Equals” to “Workflow Data” and select “prefixedNextNumber” from the pull down list.

How Do I… Create an Auto-Number using Nintex Workflow 17 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

4. Your screen should now look similar to Figure 27:

Figure 27 - The Updated "Configure Action" Screen

5. Click “Save” to return to the workflow screen. Configure “Increment the Source Number” Once we have updated the Document Library’s “Item #” field, we need to update the “Master Numbers” list to increment the “Source Number” field by 1.

Figure 28 - The "Increment the Source Number" Action

Create the Variable Firstly, we need to create a new variable “nextNumberPlus1” where we will store the new number:

1. Double-click on the action icon. 2. Access the variables screen. 3. Set “Name” to “nextNumberPlus1”. 4. Set type to “Number”. 5. Your screen should now look like Figure 29:

How Do I… Create an Auto-Number using Nintex Workflow 18 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

Figure 29 - The "nextNumberPlus1" Variable Screen

6. Click “Save” to save the new variable and return to the “Configure Action” screen.

Configure the Action Once we have the new variable ready, we can configure our action to utilize it.

1. Set the “Calculation” field to “Workflow Data.” 2. Select the “nextNumber” variable from the drop down list. 3. Set the desired function to “Plus”. 4. Set the next field to “Value”. 5. Set the “Value” field to “1”. 6. Set the “Store Results In” to the variable we just created. 7. Your screen should now look very similar to Figure 30.

Figure 30 - The Configured Action Screen

8. Click “Save” to return to the Workflow screen.

How Do I… Create an Auto-Number using Nintex Workflow 19 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Configure “Update the Master List with the Source Number Plus 1” We are now ready to update the Master Numbers list so that the Source Number is incremented accordingly.

Figure 31 - The "Update the Master List with the Source Number Plus 1" Action

Configure the Action To configure the action:

1. Double-click on the action icon. 2. Set the “Update” field to the name of our source list (in our example “Master Numbers”.) 3. Set the “Where” field to “Source Number”. 4. Set the “Equals” field to “Workflow Data”. 5. Set the “Variable” field to “nextNumber”. 6. Set “Field” to “Source Number”. 7. Set “Equals” to “Workflow Data”. 8. Set the variable field to “nextNumberPlus1”. 9. Your screen should now look like Figure 32.

Figure 32 - Updated "Configure Action" Screen

10. Click “Save” to return to the Workflow screen.

How Do I… Create an Auto-Number using Nintex Workflow 20 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Configure How the Workflow Starts Once we have our workflow configured, we need to set it to start automatically whenever a new entry is added to our Document Library. To do this, from the Nintex Workflow screen:

1. Click the “Workflow Settings” icon.

Figure 33 - The "Workflow Settings" Icon

2. The “Workflow Settings” page will then appear. 3. Uncheck the “Start manually” box. 4. Set “Start when items are created” to “Yes”. 5. Set “Start when items are modified” to “No”. 6. Your screen should now look like Figure 34:

Figure 34 - The "Workflow Options" Screen

7. Click “Save” to return to the Workflow screen.

How Do I… Create an Auto-Number using Nintex Workflow 21 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Save To save the workflow, click the “Save” button on the Workflow page.

Figure 35 - The "Save" Workflow Button

When prompted, enter a title and description for the workflow and then click “Submit”:

Figure 36 - The "Set Title & Description" Save Screen

The system will then confirm that the workflow has been saved.

Figure 37 - The Workflow Saved Successful Screen

How Do I… Create an Auto-Number using Nintex Workflow 22 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Publish Once the workflow is fully configured, it must be published to be usable. To publish the workflow, click the “Publish” button on the Workflow page:

Figure 38 - The Workflow "Publish" Button

When prompted, confirm the title and description are correct for the workflow and then click “Submit”:

Figure 39 - The Publish "Set Title & Description" Screen

How Do I… Create an Auto-Number using Nintex Workflow 23 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users Populate the List Once the workflow has been created, configured and published, we are then ready to test it.

1. Access the document library. 2. Click the “New Document” button. 3. Click the “Upload Existing Document” link.

Figure 40 - The New Document "Upload Existing File" Option

4. Browse to the file you wish to upload and select it. 5. Click “OK” to upload the file. 6. The properties screen for the file will then be displayed:

Figure 41 - The New Document "Properties" Screen

7. The “Name” field will reflect the name of the item. 8. Provide a descriptive “Title” for the file. How Do I… Create an Auto-Number using Nintex Workflow 24 V1.2/0417 © WSP USA, 2017

HOW DO I… A Quick Lesson for ProjectSolveSP Users

9. Do NOT type in the “Item #” field (as that will throw errors on the auto-number process.) 10. Click “Save” to save the file to the document library.

The file should appear with the new auto-number automatically generated.

Figure 42 - The Populated Item #

Source Material The information provided within this “How Do I …” document is based on the following Nintex tutorial: https://habaneroconsulting.com/insights/nintex-workflows-makes-it-easy-to-create-an-auto-incrementing- column-in-sharepoint#.VUuLv7HnaUk

How Do I… Create an Auto-Number using Nintex Workflow 25 V1.2/0417 © WSP USA, 2017