Search This Blog

Tuesday, January 27, 2015

Creating Custom Workflows with SharePoint Designer 2013

Lesson Goals

  1. Learn about workflow basics.
  2. Learn how to create a List Workflow using SharePoint Designer 2013.
  3. Learn how to run a workflow.
  4. Learn how to view a workflow's history.
  5. Learn how to add Actions to a workflow.
  6. Learn how to add Conditions to a workflow.
  7. Learn how to add parameters to a workflow initiation form.
  8. Learn how to create a reusable workflow.
  9. Learn how to associate a reusable workflow with a list/library.

Workflow Basics

Workflows are a popular way to perform automated work in SharePoint. The pay versions of SharePoint Server, Standard and Enterprise, come with extra out-of-box workflows that can be associated and configured with lists and libraries using just the browser. Custom workflows can be created with software applications such as SharePoint Designer 2013 or Visual Studio 2012.
SharePoint Designer is a powerful and fairly easy-to-use tool for creating custom workflows and does not require any formal developer skills. Visual Studio, although extremely powerful in creating custom workflows, requires developer skills to use.
The walk-throughs and exercises in this course will focus on using SharePoint Designer 2013 to create custom workflows.

Custom List Workflows

SharePoint Designer 2013 is a perfect tool for creating custom workflows for lists and libraries. When you create a list workflow, it is associated with a specific list or library at creation time and has access to any metadata of the item the workflow is run against.
The following walk-through will show you how to create a very basic custom list with a couple of custom columns. Once the list is created the walk-through shows how to use SharePoint Designer 2013 to create an associated custom workflow with the list. Later walk-throughs will build upon the workflow created in this walk-through.
  1. Create a new custom list in your site named "Workflow Demo".
    1. Click the Settings menu and choose the Add an app item.
    2. Select Custom List from the template choices and type "Workflow Demo" in the Name field.
    3. Click the Create button to complete creating the list.
  2. Add a choice column named "Colors" and a text column named "Workflow Output" to Workflow Demo list.
    1. Click the Create Column link on the LIST tab toolbar.
    2. Type "Colors" in the Column name field and select Choice for the data type option.
    3. Enter "Red", "Blue", and "Green" on separate lines in the choices field within the Additional Column Settings area.
    4. Click the OK button to complete creating the column.
    5. Click the Create Column link on the LIST tab toolbar.
    6. Type "Workflow Output" in the Column name text-box field.
    7. Click the OK button to create the column.
  3. Launch SharePoint Designer 2013 and create a List Workflow associated with the Workflow Demo list.
    1. Open SharePoint Designer 2013 and then open your team site in Designer.
    2. On the Site tab toolbar, click the List Workflow drop-down button and choose the Workflow Demo list.Custom Workflows
    3. Type "Workflow Demo-WF" in the Name field of the Create List Workflow dialog and click the OK button.Custom Workflows
  4. Leave the workflow open in SharePoint Designer for the next walk-through.

Workflow Actions

Workflow Actions are the main working component in a SharePoint Designer workflow. SharePoint Designer is limited to being able only to do things that are defined in an Action. However, SharePoint comes with a wide range of Actions out-of-box. The following is a grouped list of Actions available in a default installation of SharePoint Server 2013:
  • Core Actions
    • Add a Comment
    • Add Time to Date
    • Do Calculation
    • Log to History List
    • Pause for Duration
    • Pause until Date
    • Send an Email
    • Set Time Portion of Date/Time Field
    • Set Workflow Status
    • Set Workflow Variable
    • Stop Workflow
  • Document Set Actions (not available in SharePoint Foundation)
    • Capture a version of the Document Set
    • Send Document Set to Repository
    • Set Content Approval Status for the Document Set
    • Start Document Set Approval Process
  • List Actions
    • Check In Item
    • Check Out Item
    • Copy List Item
    • Create List Item
    • Declare Record
    • Delete Item
    • Discard Check Out Item
    • Set Content Approval Status
    • Set Field in Current Item
    • Undeclare Record (not available in SharePoint Foundation)
    • Update List Item
    • Wait for Field Change in Current Item
  • Relational Actions (not available in SharePoint Foundation)
    • Lookup Manager for a User
  • Task Actions
    • Assign a Form to a Group
    • Assign a To-do Item
    • Collect Data from a User
    • Start Approval Process (not available in SharePoint Foundation)
    • Start Feedback Process (not available in SharePoint Foundation)
  • Utility Actions
    • Extract Substring from End of String
    • Extract Substring from Index of String
    • Extract Substring from Start of String
    • Extract Substring of String from Index with Length
    • Find Interval Between Dates
Some of the actions listed are not available with SharePoint Foundation 2013.
Additional Actions can be purchased, downloaded for free, or created by in-house developers and installed in SharePoint and then configured with SharePoint Designer just like out-of-the-box actions.
SharePoint Designer workflows are created by combining as many Actions as necessary to get the job done.
The following walk-through will show you how to add and configure a couple of actions to the workflow that was created in the previous walk-through.
  1. Add a Log to History List action to the Workflow Demo-WF.
    1. Click the Action drop-down button from the Workflow tab toolbar and select the Log to History List action.Workflow Actions
    2. Click the this message link inside the Log to History List action added from the previous step.Workflow Actions
    3. Type "Hello from workflow" inside the text box field.Workflow Actions
    4. Hover and click the orange bar below the Log to History List action.Workflow Actions
    5. Type "Set Field" in the text box that appears when you start typing and press the Enter key to have SharePoint Designer insert the Set Field in Current Item action.Workflow Actions
      This is just another way to add an action to a workflow. You could also use the Workflow tab's Action drop-down button like you did with the Log to History List action.
    6. Click the field link inside the Set Field in Current Item action.Workflow Actions
    7. Choose the Workflow Output field from the drop-down list.Workflow Actions
    8. Click the value link inside the Set Field in Current Item action.Workflow Actions
    9. Type "This field was set by the Workflow Demo-WF" in the value text box.
  2. Click the Publish button in the Workflows tab toolbar to publish the workflow to our SharePoint site.Workflow Actions
  3. Create a new item in the Workflow Demo list and start an instance of the Workflow Demo-WF on it.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the new item link inside the list.
    3. Type "Item One" for the Title field and click the Save button.
    4. Click the ellipsis button to the right of Item One and select Workflows from the drop-down.
      This is just another way to add an action to a workflow. You could also use the Workflow tab's Action drop-down button like you did with the Log to History List action.
    5. Click the Workflow Demo-WF link on the Workflows page.Workflow Actions
    6. Click the Start button on the workflows initiation page.
  4. Verify the workflow actions outcome.
    1. Verify the list now has a column titled Workflow Demo-WF and the Item One item's value for the column is Completed.
    2. Verify the Workflow Output column has the text we wrote to it through the workflow.Workflow Actions
    3. Click the Completed link in the Workflow Demo-WF column.
    4. Verify the Workflow History area has the output from our workflow action.Workflow Actions

Workflow Conditions

Workflow conditions are a way to control which Actions run or don't run within a workflow. Conditions provide workflows with If-Then and Else-If blocks to wrap Actions. SharePoint Designer provides the following conditions for use within custom workflows:
  • Common Conditions
    • If any value equals value
    • If current item field equals value
  • Other Conditions
    • Created by specific person
    • Created in a specific date span
    • Modified by a specific person
    • Modified in a specific date span
    • Person is a valid SharePoint user
    • Title field contains keywords
The following walk-through will show you how add a couple If current item field equals value conditions that will run different Log to History List actions based on valued within the Colors column of our Workflow Demo list. The conditions will be added into the Workflow Demo-WF that was created in the previous walk-through.
  1. Add If current item field equals value conditions to check for the different color values within the Colorscolumn of a Workflow Demo list item.
    1. Switch back to SharePoint Designer and the editor view of our Workflow Demo-WF workflow.
    2. Hover and click the orange bar below the last action.Workflow Conditions
    3. Click the Condition drop-down button and choose the If current item field equals value option.Workflow Conditions
    4. Click the field link in the condition and choose the Colors option from the drop-down list.Workflow Conditions
    5. Click the value link and choose the Red option from the drop-down list.Workflow Conditions
    6. Click the Else-If Branch button on the Workflow tab tool bar twice to add two more condition blocks to the workflow.Workflow Conditions
    7. Click the orange bar below the (Insert a condition) label and type "If current" and press the Enter key to have the editor fill in the rest.Workflow Conditions
    8. Click the field link inside the Else if branch and choose the Colors field from the drop-down list.Workflow Conditions
    9. Click the value link and choose the Blue color option from the drop-down list.
  2. Add a Log to History List action inside each of the condition branches.
    1. Click the (Start typing or use the Insert group in the Ribbon.) label in the first condition branch and type "Log" in the text box and press the Enter key to have the editor fill in the rest of the action.Workflow Conditions
    2. Click the this message link inside the Log to History List action and type "This items color choice was red" in the text-box field.Workflow Conditions
    3. Repeat the previous steps to add a Log to History List action inside the other two condition branches with messages reflecting "Blue" and "Green". The final condition branches should look like the following image:Workflow Conditions
  3. Click the Publish link in the Workflow tab toolbar to update the SharePoint site with the current changes.
  4. Test the condition branches in the Workflow Demo list.
    1. Switch back to the browser window and click the Workflow Demo link in the sites Quick Launch menu.
    2. Click the Workflows link from the item menu of Item One.
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Click the Start button to start the workflow.
    5. Click the Completed link in the Workflow Demo-WF column for Item One.
    6. Verify the Workflow History has an entry with a message appropriate for the items Colors field.Workflow Conditions

Workflow Initiation Form

Initiation forms can be used with a SharePoint workflow to pass additional information into the workflow from the user who starts it. SharePoint Designer 2013 offers a wizard-driven interface for creating parameters and generating the Initiation form. The form that SharePoint Designer creates can be further customized with Microsoft InfoPath.
One drawback to using Initiation form parameters is that they work only if the workflow is manually started on an item. If a workflow is set to automatically start when an item is modified or created, then there is no opportunity for the user to interact with the Initiation form. The following shows the workflow settings and configuration tab in SharePoint designer with the Start Options and Initiation form outlined:Workflow Initiation Form
The following walk-through will show you how to add an Initiation parameter to the Workflow Demo-WF created in the previous walk-throughs in this lesson.
  1. Add Single line of text parameter named "Input Data" to the Workflow Demo-WF using SharePoint Designer.
    1. Switch back to SharePoint Designer and the editor view of our Workflow Demo-WF workflow.
    2. Click the Initiation Form Parameters button on the Workflow tab toolbar.Workflow Initiation Form
    3. Click the Add... button on the Association and Initiation Form Parameters dialog window.Workflow Initiation Form
    4. Type "Input Data" in the Field name field of the Add Field dialog window.Workflow Initiation Form
    5. Click the Next button.
    6. Click the Finish button.
    7. Click the OK button on the Association and Initiation Form Parameters dialog window.
  2. Modify the Set Field in Current Item workflow action to write the parameter information from the Initiation form into the Workflow Output field of the list item.
    1. Click the This field was set by the Workflow De... link of the Set Field in Current Item action.Workflow Initiation Form
    2. Click the fx button next to the text box to open the Lookup for Single line of text dialog window.Workflow Initiation Form
    3. Click the Data source drop-down and select the Workflow Variables and Parameters option.Workflow Initiation Form
    4. Click the Field from source drop-down and select Parameter: Input Data option.Workflow Initiation Form
    5. Click the OK button to save the settings.
  3. Click the Publish button to save the workflow changes back to the SharePoint server.
  4. Run the Workflow Demo-WF to test the Initiation form parameter.
    1. Switch back to the browser window and click the Workflow Demo link in the site's Quick Launch menu.
    2. Click the Workflows link from the item menu of Item One.
    3. Click the Workflow Demo-WF link under the Start a New Workflow heading.
    4. Type "Hello from the initiation form!" in the Input Data field of the Initiation form.Workflow Initiation Form
    5. Click the Start button to start the workflow.
    6. Verify the Workflow Output field for Item One has the text from the Initiation form.Workflow Initiation Form

Reusable Workflows

Reusable workflows allow you to create a workflow backed by a SharePoint Content Type instead of an existing list or library. Once the content type is assigned to a list or library, the workflow can be associated with that same list or library. Unlike creating a List Workflow, a reusable workflow does require extra steps of associating the workflow with the list/library. The benefit is that the workflow can be used on as many lists/libraries that support the content type without having to re-create the workflow.
The following walk-through shows how to use SharePoint Designer to create a reusable workflow for the Documentcontent type.
  1. Launch SharePoint Designer 2010 and create a Reusable Workflow associated with the Document content type.
    1. If SharePoint Designer is not already open, click the Site Actions menu and choose the Edit in SharePoint Designer option.
    2. Click the Workflows link in the Navigation menu.Reusable Workflows
    3. From the Workflows tab toolbar, click the Reusable Workflow.Reusable Workflows
    4. Type "Reusable Demo-WF" in the Name field of the Create Reusable Workflow dialog window.
    5. Select Document in the Content Type drop-down field of the Create Reusable Workflow dialog window.Reusable Workflows
    6. Click the OK button to complete creating the new reusable workflow.
  2. Add a Log to History List action to the Reusable Demo-WF workflow.
    1. Click the Action drop-down button on the Workflow tab toolbar and choose the Log to History List action.
    2. Click the this message link in the Log to History List action and click the ellipsis button to the right of the text box to open the String Builder dialog.Reusable Workflows
    3. Type "Reusable demo workflow started on: " in the text box and click the Add or Change Lookup button at the bottom of the String Builder dialog window.Reusable Workflows
    4. Select Name (for use in forms) for the Field from source field in the Lookup for String dialog window and click the OK button.Reusable Workflows
    5. Click the OK button to close the String Builder dialog.
  3. Click the Publish button in the Workflow tab toolbar to save and publish the new workflow to SharePoint.
  4. Associate the Reusable Demo-WF with the Documents library.
    1. Switch back to the browser window and click the Documents link in the sites Quick Launch menu.
    2. Click the Library Settings button on the LIBRARY tab toolbar.
    3. Click the Advanced settings link under the General Settings group.
    4. Click the Yes radio button for the Allow management of content types option.Reusable Workflows
    5. Click the OK button to save the setting.
    6. Click the Workflow Settings link under the Permissions and Management area of the Document Library Settingspage.Reusable Workflows
    7. Click the Add a workflow link.Add a workflow.
    8. Select Document in the Run on items of this type drop-down list field.Reusable Workflows
    9. Select Reusable Demo-WF in the Select a workflow template list-box field.Reusable Workflows
    10. Type "Shared Docs Reusable WF" in the Name field.
    11. Check the box labeled Creating a new item will start this workflow in the Start Options group.Reusable Workflows
    12. Click the OK button to save.
  5. Run the Shared Docs Reusable WF against an item in the Documents library.
    1. Click the Documents link in the sites Quick Launch menu.
    2. Click the new document link to upload a new document to the library.
    3. Click the Browse button.
    4. Use the Choose File to Upload dialog to select the EvaluateSharePointServer2010-ITPro document from the class files you downloaded and click the Open button.
    5. Click the OK button on the Upload Document dialog.
    6. Type "Workflow Test" in the Title field and click the Save button to complete uploading the file.
    7. Click the Completed link under the Shared Docs Reusable WF column to open the workflow history page for item.
    8. Verify the Workflow History has the text entry from the Log to History List action with the file name included.Reusable Workflows

Creating Custom List Workflows

Duration: 15 to 25 minutes.
  1. Navigate to your team site.
  2. Import the Time-off-request-list-template.stp list template file and create a new list using the template. The new list will be used later in the exercise with a custom workflow.
    1. Click the Settings menu then click the Site Settings option.Exercise - Custom Workflows
    2. Click the List templates link on the Site Settings page within the Web Designer Galleries group.Exercise - Custom Workflows
    3. Click the FILES tab to open the toolbar then click the Upload Document link button.Exercise - Custom Workflows
    4. Click the Browse button in the Upload Template dialog.
    5. Navigate to the folder you downloaded the class files to and select the Time-off-request-list-template.stp file and click the Open button on the Choose File to Upload dialog window.
    6. Click the OK button on the Add a template dialog.Exercise - Custom Workflows
    7. Click the Save button on the List Template Gallery dialog to save the file into the gallery.
    8. Click the Settings menu then choose the Add an app option.Exercise - Custom Workflows
    9. Type "time-off" in the search field and click the search icon.Exercise - Custom Workflows
    10. Select the Time-Off Requests template from the list template.Exercise - Custom Workflows
    11. Type "Time-Off Requests" in the Name: field and click the Create button to complete creating the new list.New list.
    12. Click the Time-Off Requests link in the Quick Launch and verify the new list has the following columns: Name,Start DateEnd DateReasonManager, and Manager Feedback.
      The columns were defined in the list template that the list was created with. If the list does not have these columns, make sure the list was created with the template imported in the earlier steps.
      Exercise - Custom Workflows
  3. Open the site in SharePoint Designer 2013.
  4. Using SharePoint Designer, create a new List Workflow for the Time-Off Requests list.
    1. Click the List Workflow drop-down button on the Site tab toolbar within the New group and select Time-Off Requests from the list.Exercise - Custom Workflows
    2. Type "Time-Off Request WF" in the Name field of the Create List Workflow dialog window and click the OK button to finish creating it.Exercise - Custom Workflows
  5. Add a Log to History List action to the new workflow.
    1. Click the Action drop-down button in the Workflow tab toolbar and select the Log to History List option.Exercise - Custom Workflows
    2. Click the this message link within the workflow editor work area.Exercise - Custom Workflows
    3. Click the ellipsis button next to the log message text box to open the String Builder editor.Exercise - Custom Workflows
    4. Type "Time-Off request started for:" in the Name field then with you insertion point at the end of the line after the colon and click the Add or Change Lookup button.Exercise - Custom Workflows
    5. In the Lookup for String dialog box, leave the Data source field set to Current Item and select Name in the Field from source drop-down field.Exercise - Custom Workflows
    6. Click the OK button on the Lookup for String dialog to close and save your choices.
    7. Click the OK button on the String Builder dialog to close it and save the string.
  6. Add an action that will collect data from a user using a custom task.
    1. Hover your mouse pointer under the Log to History List action you created in the previous steps and click on the orange bar that appears.Exercise - Custom Workflows
    2. Type the word "collect" and the orange bar will change into a text box like the following image:Exercise - Custom Workflows
      This is just another way to add an action to a workflow. You could also use the Workflow tab's Action drop-down button like you did with the Log to History List action.
    3. Press your Enter key to have the editor add the Collect Data from a User action.Exercise - Custom Workflows
    4. Click the data link in the Collect Data from a User action to open the Custom Task Wizard dialog.Exercise - Custom Workflows
    5. Click the Next button on the first page of the Custom Task Wizard dialog.
    6. On the second page of the Custom Task Wizard dialog, change the Name field to "Time-Off Request Task" and click the Next button.Exercise - Custom Workflows
    7. On the third page of the Custom Task Wizard dialog, click the Add button to add a new field to the custom task.Exercise - Custom Workflows
    8. Type "Time-Off Response" in the Field name field and choose Choice (menu to choose from) in the Information type drop-down field and click the Next button.Exercise - Custom Workflows
    9. Type "Approved" and "Denied" on separate lines in the Choices field of the Column Settings dialog and click theFinish button.Exercise - Custom Workflows
    10. Click the Add button back on the Custom Task Wizard dialog to add a second field to the list.Exercise - Custom Workflows
    11. Type "Manager Comments" in the Field name field and choose Multiple lines of text in the Information typedrop-down field of the Add Field dialog and click the Next button.Exercise - Custom Workflows
    12. Leave the Default value field blank and click the Finish button on the Column Settings dialog.
    13. Click the Finish button on Custom Task Wizard dialog to save the custom task.
    14. Click the this user link in the Collect Data from a User action to open the Select Users dialog.Exercise - Custom Workflows
    15. Select Workflow Lookup for a User... option within the list box and click the Add button on the Select Usersdialog.Exercise - Custom Workflows
    16. Select Manager in the Field from source drop-down list field and click the OK button on the Lookup for Person or Group dialog.Exercise - Custom Workflows
    17. Click the OK button to close and save your choice on the Select Users dialog.
  7. Add an action that will retrieve the Manager Comments from the previous task action into the Manager Feedback field of the list item.
    1. Hover and click the orange bar below Collect Data from a User action.Exercise - Custom Workflows
    2. Click the Action button drop-down in the Workflow tab toolbar and choose the Set Field in Current Item action from the list.Exercise - Custom Workflows
    3. Click the field link in the Set Field in Current Item action and choose Manager Feedback from the drop-down list.Exercise - Custom Workflows
    4. Click the value link in the Set Field in Current Item action and then click the ellipsis button to open the String Builder dialog.Exercise - Custom Workflows
    5. Type "Request feedback from Manager: " in the String Builder field and then click the Add or Change Lookupbutton.Exercise - Custom Workflows
    6. Select Association: Task List from the Data source drop-down field.Exercise - Custom Workflows
    7. Select ID from the Field drop-down field.Exercise - Custom Workflows
    8. Click the fx button next to the Value field text box.Exercise - Custom Workflows
    9. Select Workflow Variables and Parameters from the Data source field drop-down list in the Lookup for Integerdialog.Exercise - Custom Workflows
    10. Select Variable: collect from the Field from source field drop-down list in the Lookup for Integer dialog.Exercise - Custom Workflows
    11. Click the OK button to save your choices and close the Lookup for Integer dialog.
    12. Select Manager Comments from the Field from source field drop-down list.Exercise - Custom Workflows
      The Manager Comments custom task field will not show in the list until you've completed the Find the List Item portion of the Lookup for String dialog. The Find the List Item portion is how the workflow retrieves the specific task that was created by previous workflow action.
    13. Click the OK button to close the Lookup for String dialog and save your settings.
    14. Click the OK button to close the String Builder dialog and save your string.
  8. Add a Set Workflow Variable action that store the Time-Off Response of the custom task action created in previous steps. The workflow variable will be used in later steps with a condition to send different emails based on the Manager's response in the custom task.
    1. Hover and click the orange bar below Set Field in Current Item action.Exercise - Custom Workflows
    2. Select Set Workflow Variable from the Action drop-down list in the Workflow tab toolbar.Exercise - Custom Workflows
    3. Click the workflow variable link in the new action and select Create a new variable from the drop-down list.Exercise - Custom Workflows
    4. Type "Response" in the Name field and select String in the Type field and click the OK button to close the Edit Variable dialog and save your settings.Exercise - Custom Workflows
    5. Click the Value link of the Set Workflow Variable action.Exercise - Custom Workflows
    6. Click the fx button next to the Value field text box.Exercise - Custom Workflows
    7. Select Association: Task List from the Data source drop-down field.Exercise - Custom Workflows
    8. Select ID from the Field drop-down field.Exercise - Custom Workflows
    9. Click the fx button next to the Value field text box.Exercise - Custom Workflows
    10. Select Workflow Variables and Parameters from the Data source field drop-down list in the Lookup for Integerdialog.Exercise - Custom Workflows
    11. Select Variable: collect from the Field from source field drop-down list in the Lookup for Integer dialog.Exercise - Custom Workflows
    12. Click the OK button to save your choices and close the Lookup for Integer dialog.
    13. Select Time-Off Response from the Field from source field drop-down list.Exercise - Custom Workflows
      The Time-Off Response custom task field will not show in the list until you've completed the Find the List Item portion of the Lookup for String dialog. The Find the List Item portion is how the workflow retrieves the specific task that was created by previous workflow action.
    14. Click the OK button to close the Lookup for String dialog and save your settings.
  9. Add an If any value equals value condition to the workflow.
    1. Hover and click the orange bar below the last action in the workflow.Exercise - Custom Workflows
    2. Select If any value equals value option from the Condition drop-down button in the Workflow tab toolbar.Exercise - Custom Workflows
    3. Click the value link in the workflow condition.Exercise - Custom Workflows
    4. Click the fx button next to the value text box.Exercise - Custom Workflows
    5. Select Workflow Variables and Parameters for the Data source field of the Define Workflow Lookup dialog.Exercise - Custom Workflows
    6. Select Variable: response for the Field from source field of the Define Workflow Lookup dialog.Exercise - Custom Workflows
    7. Click the OK button to close the Define Workflow Lookup and save your settings.
    8. Click the value link in the workflow condition and type "Approved", without the quotes, in the text box.Exercise - Custom Workflows
  10. Add a Send an Email action inside the If condition.
    1. Hover and click the orange bar directly below the label (Start typing or use the Insert group in the Ribbon).Exercise - Custom Workflows
    2. Select Send an Email from the Action menu drop-down button on the Workflow tab toolbar.Exercise - Custom Workflows
    3. Click the these users link in the Send an Email action.Exercise - Custom Workflows
    4. Click the User Lookup icon, looks like a book, next to the To field in the Define E-mail Message dialog.Exercise - Custom Workflows
    5. Click the Workflow Lookup for a User... option and click the Add button in the Select Users dialog.Exercise - Custom Workflows
    6. Select Created By in the Field from source drop-down list field of the Lookup for Person or Group dialog.Exercise - Custom Workflows
    7. Click the OK button to close the Lookup for Person or Group dialog and save your settings.
    8. Click the OK button to close the Select Users dialog and save your settings.
    9. Type "Vacation Request Approved" in the Subject field of the Define E-mail Message dialog.
    10. Type "Your vacation request has been approved" in the Body field of the Define E-mail Message dialog and click theOK button to close and save.
  11. Add an Else block to the If condition.
    1. Hover and click the orange bar below the Send an Email action.Exercise - Custom Workflows
    2. Click the Else-If Branch button on the Workflow tab toolbar to add an Else block to the If condition.Exercise - Custom Workflows
    3. Hover and click the orange bar directly below the Else label.Exercise - Custom Workflows
    4. Select Send an Email from the Action menu drop-down button on the Workflow tab toolbar.Exercise - Custom Workflows
    5. Click the these users link in the Send an Email action.Exercise - Custom Workflows
    6. Click the User Lookup icon, which looks like a book, next to the To field in the Define E-mail Message dialog.Exercise - Custom Workflows
    7. Click the Workflow Lookup for a User... option and click the Add button in the Select Users dialog.Exercise - Custom Workflows
    8. Select Created By in the Field from source drop-down list field of the Lookup for Person or Group dialog.Exercise - Custom Workflows
    9. Click the OK button to close the Lookup for Person or Group dialog and save your settings.
    10. Click the OK button to close the Select Users dialog and save your settings.
    11. Type "Vacation Request Rejected" in the Subject field of the Define E-mail Message dialog.
    12. Type "Your vacation request has been rejected" in the Body field of the Define E-mail Message dialog and click theOK button to close and save.
  12. Save the Time-Off Request WF workflow.
    1. Click the Save icon in the upper-left corner the SharePoint Designer window.Exercise - Custom Workflows
  13. Change the Time-Off Request WF to start automatically when a new item is added to the list.
    1. Click the Time-Off Request WF breadcrumb at the top of the workflow editor area.Exercise - Custom Workflows
    2. Check the Start workflow automatically when an item is created check box under Start Options.Exercise - Custom Workflows
  14. Publish the Time-Off Request WF workflow.
    1. Click the Publish button on the Workflow Settings tab toolbar.Exercise - Custom Workflows
  15. Create a new item in the Time-Off Requests list to test the custom workflow.
    1. Switch back to your browser window or open one if you don't have one already open and browse to your site.
    2. Click the Time-Off Requests link in the site's Quick Launch menu.
    3. Click the new item link in the list.Exercise - Custom Workflows
    4. Enter the following information in the Time-Off Requests- New Item dialog and replace the Name and Managerfields with your account:
      NameSP_Admin
      Start DateSelect the following week's Monday
      End DateSelect the following week's Friday
      ReasonGoing Fishing
      ManagerSP_Admin
    5. Click the Save button to save the new time-off request item.
    6. Click the Time-Off Requests link in the site's Quick Launch menu to refresh the page.
    7. Verify the column Time-Off Request WF has been added and the status for the new list item is In Progress.Exercise - Custom Workflows
      Until the task created by the workflow is completed, the workflow will remain In Progress. Once the task is completed, the workflow will continue to the next action defined in the workflow.
  16. Complete the Time-Off Request WF custom task.
    1. Click the Site Contents link in the site's Quick Launch menu.
    2. Click the Tasks link on the Site Contents page.
    3. Click the Time-Off Request Task link to open it.Exercise - Custom Workflows
    4. Select Approved in the Time-Off Response drop-down field and type "Of course, you can have all the time off you want!" in the Manager Comments field.Exercise - Custom Workflows
    5. Click the Complete Task button to complete the task and continue the workflow.
  17. Verify the Time-Off Request WF custom workflow has completed.
    1. Click the Time-Off Requests link in the site's Quick Launch menu.Exercise - Custom Workflows
    2. Verify the Manager Feedback column includes the Manager's comments and the Time-Off Request WF column status is Completed.Exercise - Custom Workflows
    3. Click the Completed link in the Time-Off Request WF column to view the workflow history.
    4. Verify the Log to History List action in your workflow added the custom message to the history log.Exercise - Custom Workflows
  18. Verify the email was sent.
    1. Open Microsoft Outlook.
    2. Open the email message from your site with the subject of Vacation Request Approval and verify the body matches what you configured in the workflow.Exercise - Custom Workflows
    3. Close the email message and close Outlook.

Creating Reusable Workflows

Duration: 15 to 25 minutes.
  1. Create a reusable workflow for the document content type using SharePoint Designer.
    1. Navigate back to SharePoint Designer or open a new instance if you closed it from the previous exercise.
    2. If the Time-Off Request WF is still open from the previous exercise, click the Workflows breadcrumb at the top of the editor tab.Exercise - Reusable WorkflowsOr if you closed it, you can click the Workflows link in the Navigation menu.Exercise - Reusable Workflows
    3. Click the Reusable Workflow link in the WORKFLOWS tab toolbar New group.Exercise - Reusable Workflows
    4. Type "Reusable Doc WF" in the Name field and choose Document in the Content Type drop-down field and click the OKbutton.Exercise - Reusable Workflows
  2. Add an Association Column to the Reusable Doc WF.
    1. Click the Association Columns button in the WORKFLOW tab toolbar in the Variables group.Exercise - Reusable Workflows
    2. Click the Add New Column... button on the Association Columns dialog.Exercise - Reusable Workflows
    3. Type "Reusable WF Feedback" in the Field name field and click the Next button on the Add Column dialog.Exercise - Reusable Workflows
    4. Leave the Default value field empty and click the Finish button of the Column Settings dialog.
    5. Click the OK button to close the Association Columns dialog and save your column setting.
  3. Add a Set Field in Current Item action to the Reusable Doc WF and configure it to write text into the Reusable WF Feedback associated column.
    1. Hover and click the orange bar within Step 1 of the Reusable Doc WF.Exercise - Reusable Workflows
    2. Click the Action drop-down button in the Workflows tab toolbar and choose the Set Field in Current Itemaction.Exercise - Reusable Workflows
    3. Click the field link in the Set Field in Current Item action and choose the Reusable WF Feedback option from the drop-down list.Exercise - Reusable Workflows
      Only fields defined in the content type and associated columns are available to use in a reusable workflow.
    4. Click the value link in the Set Field in Current Item action.Exercise - Reusable Workflows
    5. Type "This message was created by the Reusable Doc WF!" in the value text box.
  4. Publish the Reusable Doc WF.
    1. Click the Publish button in the WORKFLOW tab toolbar's Save group.Exercise - Reusable Workflows
  5. Associate and test the Reusable Doc WF workflow with the Shared Documents library of your site.
    1. Switch back to your browser window or open one if you don't have one already open and browse to your assigned student site.
    2. Click the Documents link in the site's Quick Launch menu.Exercise - Reusable Workflows
    3. Click the FILES tab to open the toolbar and click the New Document button.Exercise - Reusable Workflows
    4. Type "This is a sample document for use with a reusable workflow." in the new Word document and click the Saveicon in the upper-left corner of the Microsoft Word window.
    5. Click Shared Documents from the Other Web Locations on the Word Save As page.
    6. Type "Sample WF Doc" in the File name field and click the Save button.
    7. Close Microsoft Word.
    8. Click the LIBRARY tab to open the toolbar and click the Library Settings button.Exercise - Reusable Workflows
    9. Click the Advanced settings link under the General Settings group.
    10. Click the Yes radio button for the Allow management of content types option.Exercise - Reusable Workflows
    11. Click the OK button to save the setting.
    12. Click the Workflow Settings link under Permissions and Management.Exercise - Reusable Workflows
    13. Click the Add a workflow link.
    14. Select Document from the Run on items of this type drop-down field.Exercise - Reusable Workflows
    15. Select Reusable Doc WF from the Select a workflow template list box.Exercise - Reusable Workflows
    16. Type "Reusable Document WF Test" in the Type a unique name for this workflow field.Exercise - Reusable Workflows
    17. Leave the rest of the workflow settings at their defaults and click the OK button at the bottom of the form.
    18. Click the Documents link in the site's Quick Launch menu to navigate back the default view of the library.
    19. Click the ellipsis link next to the Sample WF Doc link then click the second ellipsis link in the balloon pop-up to open the context menu and click the Workflows link.Exercise - Reusable Workflows
    20. Click the Reusable Document WF Test link.Exercise - Reusable Workflows
    21. Click the Start button to start the workflow.
    22. Verify the Reusable Document WF Test column has the status of Completed.Exercise - Reusable Workflows
    23. Click the ellipsis link next to the Sample WF Doc link and then click the second ellipsis link in the balloon pop-up to open the context menu and click the Edit Properties link.Exercise - Reusable Workflows
    24. Verify the Reusable WF Feedback field exists and has the text "This message created by the Reusable Doc WF!" in it.Exercise - Reusable Workflows

No comments:

Post a Comment