WEBSITE

Creating Custom Workflows with SharePoint Designer 2010 (part 2) - Workflow Actions, Creating a Simple Workflow

1/1/2014 8:48:17 PM

3. Workflow Association Options

When you create a new reusable workflow, it cannot be used until it has been associated with a list or Content Type. When you open the workflow in Designer, you will have both association options in the ribbon in the Manage section. When you click Associate to List, you will see all the available lists to associate with. Similarly, when you click Associate to Content Type, you will see available Content Types. The benefit of associating a workflow to a Content Type is that it will work for all items using that Content Type in any list where the Content Type is in use.

4. Workflow Actions

SharePoint Designer ships with a set of actions specifically for SharePoint interaction. This list can be extended by installing third-party actions or even developing your own. Table 1 lists all the actions provided with Designer.

Table 1. Actions to Choose from When Developing a Workflow in Designer
ActionDescriptionAvailable in Visio?
Core
Add a CommentAt the time of this writing, this action does not do anything in the release candidate version of SharePoint 2010.Y
Add Time To DateAdds a time period to a date variable.Y
Do CalculationDoes a basic calculation such as addition and outputs to a variable.Y
Log to History ListWrites an entry to the workflow history.Y
Pause for DurationPauses the workflow for a defined period.Y
Pause until DatePauses the workflow until a defined date.Y
Send an E-mailDefines e-mail recipients, subject, and body.Y
Set Time Portion of Date/Time FieldSets time value and outputs to a variable.Y
Set Workflow StatusSets status of current workflow.Y
Set Workflow VariableUses a workflow variable to store values.Y
Stop WorkflowTerminates the workflow.Y
Document Set Actions
Capture a Version of the Document SetCan specify document set with major or minor versions.N
Send Document Set to RepositoryCopies or moves a set to a defined content organizer.Y
Set Content Approval Status for the Document SetSets the status with comments.Y
Start Document Set Approval ProcessKicks off an approval process for the set for list of users.Y
List Actions
Check In ItemChecks in the item and provides comments.Y
Check Out ItemChecks out the item.Y
Copy List ItemCopies an item from one list to another.Y
Create List ItemCreates an item and outputs it to a variable.Y
Declare RecordDeclares current item as a record. 
Delete ItemDeletes defined item in listY
Discard Check Out ItemIf item is checked out it will be discarded.Y
Set Content Approval StatusSets status to Approved, Rejected, or Pending.Y
Set Field in Current ItemUpdates field value.Y
Undeclare RecordIf an item is a record, it will be reverted. 
Update List ItemCommits any changes made to item.Y
Wait for Field Change in Current ItemPauses workflow until a field value condition is met.Y
Relational Actions
Lookup Manager of a UserGets manager from Active Directory.Y
Task Actions
Assign a Form to a GroupDefines a form with simple fields and assigned to list of users.Y
Assign a to-do ItemCreates a task for a user and adds to workflow task list.Y
Collect Data from a UserBuilds a custom form and outputs values to variable.Y
Start Approval ProcessKicks off an Approval workflow.Y
Start Custom Task ProcessKicks off a Task workflow.Y
Start Feedback ProcessKicks off a Feedback workflow.Y
Utility Actions
Start Feedback ProcessKicks off a Feedback workflow.Y
Extract Substring from End of StringManipulates a string value.N
Extract Substring from Index of StringManipulates a string value.N
Extract Substring from Start of StringManipulates a string value.N
Extract Substring of String from Index with LengthManipulates a string value.N
Find Interval Between DatesManipulates a string value.N

5. Creating a Simple Workflow

We covered the basics of Workflows in SharePoint Designer 2010; let’s create a simple workflow to see how it actually works. For our example, we are going to create a site workflow that allows a site member to request elevated privileges—so a visitor can request to be upgraded to a member, and a member can request to be upgraded to an owner. All the site workflow will do is e-mail the administrator with the request, so it does not need to be associated with a list item.

For our workflow, we need to

  • Define the initiation variable for the requested role.

  • Create a step to e-mail the administrator.

  • Create a task for the administrator.

  • Write to the workflow history.

Let’s get started. From the workflow tab in SharePoint Designer, click the Site Workflow icon in the ribbon to create a new workflow. Figure 4 shows the dialog where we enter the workflow name and description.

Figure 4. The Site Workflow dialog allows you to enter a workflow title and description

The main pane starts with a Step 1 for the workflow (see Figure 5). The Insert group on the ribbon has options to allow you to add workflow elements such as conditions or actions. Our workflow will have three simple steps, which are described here:

1.
Send e-mail. Edit the e-mail to include the user name and site name and send to the administrator.

2.
Create task. Create a task for the administrator.

3.
Write to history. Track the request in the workflow history.

Figure 5. The new workflow starts with Step 1. A condition or action needs to be added to this step.

Before defining the workflow steps, we create an initiation form parameter that will be used for the role requested (member or owner) (see Figure 6). From the Variables group on the ribbon, click the Initiation Form Parameters icon and add a new Field called Requested Permission. This will be a Choice field where we define our choices: Member and Owner.

Figure 6. Use the initiation parameters to prompt the user for values that you can use in your workflow


Clicking Next allows you to provide the two values for our options: Member and Owner.

Step 1: Send E-mail

From the Action menu on the ribbon, select Send an E-mail. Click the link in the action to bring up the e-mail dialog as shown in Figure 7. We want to include the name of the user requesting the change, the permission level they are requesting, and the site they are requesting access to.

Figure 7. The E-Mail Message dialog allows you to specify the recipients and include values from the workflow within the subject or body of the e-mail

To include values from the workflow such as permissions level, site URL, and so on, click the Add or Change Lookup button at the bottom of the dialog. This allows you to choose values from the workflow variables, the associated task or history list, even values from other lists in the current site. Figure 8 shows selecting the Requested Permission variable so we can add it to the body of the e-mail.

Figure 8. Use the Lookup dialog to add values to the e-mail such as workflow variables, list values, or other related properties


Step 2: Create Task

Add another step to the workflow from the Insert section on the ribbon. This step is going to create the action to create a task for the administrator. Select Assign a To-Do Item from the actions menu. Clicking the link in the task action launches a wizard that asks for a task title and description (see Figure 9).

Figure 9. The Task wizard allows you to define a title and a description for the task


Step 3: Write History

The final step is going to capture the request in the workflow history log. Again from the ribbon, add another task and insert the action Log to History List. This way we can see what requests happened when. Figure 10 shows the text we are going to write to the history log. Again, we can include values from the workflow using the Add or Change Lookup button.

Figure 10. The Log to History List action allows you to keep track of workflow activities. You can include workflow properties within the text.


Figure 11 shows the end result of all the workflow steps.

Figure 11. The final list of steps for our simple workflow

Note

The steps are initially listed as Step 1, Step 2, and so on. You can rename the steps by clicking the step title and adding your own value.


 

With the workflow steps complete, we are ready to publish the workflow. Clicking the Publish icon on the ribbon will first check for errors and then publish the workflow to our site.

Other  
  •  Sharepoint 2013 : Visio Graphics Services (part 2) - Setting the Description of a Data Provider , Configuring Visio Performance Settings
  •  Sharepoint 2013 : Visio Graphics Services (part 1) - Configure the Unattended Service Account, Create a New Safe Data Provider
  •  Sharepoint 2010 : Making Business Processes Work - Using the Provided Workflows (part 3) - Checking the Workflow Status
  •  Sharepoint 2010 : Making Business Processes Work - Using the Provided Workflows (part 2) - Starting the Workflow from the Item Workflow Page, Starting the Workflow from Office 2010 Client
  •  Sharepoint 2010 : Making Business Processes Work - Using the Provided Workflows (part 1) - Associating a Workflow with a List
  •  Sharepoint 2010 : Making Business Processes Work - Getting Started with Workflow, Workflow Terminology
  •   ASP.NET 4.0 : Data Source Components (part 10) - The XmlDataSource Class
  •   ASP.NET 4.0 : Data Source Components (part 9) - The SiteMapDataSource Class - Displaying Site Map Information
  •  ASP.NET 4.0 : Data Source Components (part 8) - The LinqDataSource Class -Lazy Loading and Prefetch, Updating Data
  •  ASP.NET 4.0 : Data Source Components (part 7) - The LinqDataSource Class - Selecting, Sorting, and Filtering Data
  •  
    Top 10
    Review : Sigma 24mm f/1.4 DG HSM Art
    Review : Canon EF11-24mm f/4L USM
    Review : Creative Sound Blaster Roar 2
    Review : Philips Fidelio M2L
    Review : Alienware 17 - Dell's Alienware laptops
    Review Smartwatch : Wellograph
    Review : Xiaomi Redmi 2
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8