Workflow conditions in SharePoint Designer 2010: A quick reference guide

Use this reference guide for a quick understanding of the available conditions in SharePoint Designer 2010. Conditional logic helps you create workflows that match your organization’s processes.

In this topic


Conditions in SharePoint Designer 2010

There are two ways to view the workflow conditions in SharePoint Designer 2010. While editing a workflow in SharePoint Designer 2010:

  • On the Workflow tab, in the Insert group, click Conditions to open the list of workflow actions.
  • Alternately, you can click inside a workflow step, in the search box that appears type words that are in the name of the condition that you want, such as created by, and then press Enter. Actions and conditions that contain the words you typed appear below the text box.

Enter keywords into the workflow step and press Enter to see the list of related conditions

The conditions that are available to you during workflow creation depend on the context of the workflow. See the following illustration for more information

Available conditions in SharePoint Designer  2010

Callout 1 General conditions in SharePoint Designer 2010
Callout 2 Check exact list item permissions and Check list item permissions are available only inside the impersonation steps of your workflow.
Callout 3 The file size is a specific range kilobytes and The file type is a specific typeare available only when your workflow is associated with the Document content type, a child of the Document content type, or a library.
Callout 4 If any value equals value and Person is a valid SharePoint user are the only conditions available when you create a site workflow

Top of Page Top of Page

General conditions

This section describes the conditions that are available in SharePoint Designer 2010 for list and reusable list workflows, irrespective of the list or content type that the workflow is associated with.

If value equals value

This condition is initially displayed in a workflow step as If value equals value. Use this condition when you want to compare a value against another. Values can be static text, dynamic strings, and lookups to variables, context information, or SharePoint fields.

You can select from a wide range of operators in your condition, such as contains and is greater than. To do so, you must set the first value in the condition and then click equals. The operators that are available depend on what the first value in the condition is set to. For example, if you used the lookup dialog to set the first value in the condition to a Date and Time data type, such as Created, the Contains operator is not an option.

There are two variations of the equals and contains operators.

  • The equals and contains operators are case-sensitive.
  • The equals (ignoring case) and contains (ignoring case) are not case-sensitive.

The options that you can use for the second value in the condition also depend to some extent on what the first value in the condition is set to. Suppose that you set the first value to Created. And then you lookup the second value using a variable that is a string, such as Last 10 Characters. You would probably want to return the string As Date/Time, so that the comparison with Created will return predictable results.

 Note    You can use logical operators such as || (or) or && (and) in the condition.

Following are examples of what the condition might look like in a workflow step,

If Variable: A week from Modified is greater than Today

If Variable: Specification Name contains (ignoring case) SharePoint Designer || SPD

The If value equals value condition is one of only two conditions available when you are working in a site workflow. For more information about site workflows, see the Conditions available within a Site workflow section of this article.

If field equals value

This condition is initially displayed in a workflow step as If field equals value. Use this condition to compare a field in the current item that the list or reusable list workflow is currently running on to a value. Values can be static text, dynamic strings, and lookups to variables, context information, or other SharePoint fields.

You can click field to see the list of options. The available options for field depend on the content type, list, library, or site that the workflow is associated with. For example, a workflow that is associated with a default library will have field options such as Title, Created, and Created By.

You can select from a wide range of operators in your condition, such as contains and is greater than. To do so, you must first set field and then click equals. The operators that are available depend on what field is set to. For example, if you used the lookup dialog to set field in the condition to a Date and Time data type, such as Created, the Contains operator is not an option.

There are two variations of the equals and contains operators. The equals and contains operators are case-sensitive. The equals (ignoring case) and contains (ignoring case) are not case-sensitive. For example, if you set field to Title, and then use the contains operator and the value in your condition is Document, then the condition is true only if the title contains Document, not document. If you use contains (ignoring case), then the condition is true for both Documentdocument

The options that you can use for value also depend to some extent on what field is set to. Suppose that you set field to Created. And then you lookup the value using a variable that is a string, such as Last 10 Characters. You would probably want to return the string As Date/Time, so that the comparison with Created will return predictable results.

 Note    You can use logical operators such as || (or) or && (and) in the condition.

Following is an example of what the condition might look like in a workflow step. In the first example example, is less than equates to “earlier than”.

If Current Item:Modified is less than 1/1/2010 12:00:00 AM

If Current Item:Path contains (ignoring case) Marketing || Public Relations

Created by a specific person

This condition is initially displayed in a workflow step as If created by specific person. It checks if an item was created by a specific user. The user can be specified as an e-mail address, such as olivier@contoso.com, or selected from SharePoint, Exchange, or Active Directory users.

 Note    The user name and e-mail address are case sensitive. It is recommended that you select a user name or e-mail address to help ensure that you use the correct case. If you type a user name or e-mail address, you must match the case of the account. For example, If created by contoso\molly will not evaluate as true if the user account is Contoso\Molly.

Following is an example of what the condition might look like in a workflow step,

If created by Molly Clark

Created in a specific date span

This condition is initially displayed in a workflow step as If created between date and date. It checks if the item was created between the specified dates. You can use the current date, a specific date, or a lookup.

Following is an example of what the condition might look like in a workflow step,

If created between 1/1/2009 and 1/1/2010 12:00:00 AM

Modified by a specific person

This condition initially displays in a workflow step as If modified by specific person. Use this condition to check if an item was modified by a specified user. The user can be specified as an e-mail address, such as olivier@contoso.com, or selected from SharePoint, Exchange, or Active Directory users.

Note The user name and e-mail address are case sensitive. It is recommended that you select a user name or e-mail address to help ensure that you use the correct case. If you type a user name or e-mail address, you must match the case of the account. For example, If modified by contoso\molly will not evaluate as true if the user account is Contoso\Molly.

Following is an example of what the condition might look like in a workflow step,

If modified by Molly Clark

Modified in a specific date span

This condition is initially displayed in a workflow step as If modified between date and date. It checks if an item was modified between the specified dates. You can use the current date, a specific date, or a lookup.

Following is an example of what the condition might look like in a workflow step,

If modified between 1/1/2009 and 1/1/2009 12:00:00 AM

Person is a valid SharePoint user

This condition is initially displayed in a workflow step as If person is a valid SharePoint user. It checks if the specified user is a member of the SharePoint site.

In SharePoint Designer 2010, you can include anyone outside your corporate domain in your workflows, also known as external participants. Suppose you have assigned tasks to external participants in your workflow. You can then use this action to make a site user follow up with the external participants until the tasks are complete.

Following is an example of what the condition might look like in a workflow step,

If Molly Clark is a valid SharePoint user

The Person is a valid SharePoint user condition is one of only two conditions available when you are working in a site workflow. For more information about site workflows, see the Conditions available within a Site workflow section in this article

Title field contains keywords

This condition is initially displayed in a workflow step as If title field contains keywords. It checks if the Title field for an item contains a specific word. You can either specify the keyword in the String Builder—which can be a static value or a dynamic string or a combination — or insert a lookup to a field or variable.

 Note    You cannot search for more than one keyword in the Title field contains keywords condition. However, you can use logical operators such as || ( or) or && (and) in these following two conditions— If any value equals value or If current item field equals value (when you want to use the Title field in your current item). For an example, see the following image:Logical operators in strings can be used in conditions to search for more than one  keyword

Top of Page Top of Page

Conditions available only within an impersonation step

For security reasons, a workflow runs by default using the permissions of the user who started the workflow. In contrast, impersonation steps run with the permissions of the person who last saved the workflow– typically the workflow template author. This enables a person running a workflow to perform actions within impersonation steps that their permissions would not otherwise allow, such as archiving a document to a library to which that they only have the read permission level.

The following conditions are available only inside an impersonation step in your workflow.

Check list item permissions

This condition is initially displayed in an impersonation step as If permissions for these users are at least these permissions on item in this list. It checks if the users have at least the permissions (permissions: The specific security settings that allow or restrict access to a given item, list, library, or site.) that the specified permission level (permission level: A set of permissions that can be granted to users or SharePoint groups on an entity such as a site, library, list, folder, item, or document.) provide for an item in the list. It does not check that the users have specific permission levels. A user can be a single user, multiple users, or a group.

For the condition to evaluate as true, the users must have at least the permissions that the permission levels provide. However, the users do not need to get these permissions from the specified permission levels. For example, a user has the default Contribute permission level and the condition checks if the user has at least the permission obtained by being assigned the default Read permission level. The condition will evaluate as true, since the permissions for Read are a subset of the permissions for Contribute.

Following is an example of what the condition might look like in a workflow step,

If permissions for Contoso Members are at least Read on item in Current Items

Check list item permission levels

This condition is initially displayed in an impersonation step as If permission levels for these users are at least these permission levels on item in this list. It checks if the users have the specified permission levels for an item in the list. A user can be a single user, multiple users, but you cannot use a group in this condition.

For the condition to evaluate as true, the users must have the permission levels specified in the condition. For example, a user has the Contribute permission level and the condition checks if the user the Read permission level. The condition will evaluate as false, because the Contribute and Read are different permission levels.

Following is an example of what the condition might look like in a workflow step,

If permission levels for Contoso Members are at least Read on item in Current Items

Top of Page Top of Page

Conditions available only when the workflow is associated to a library or the Document content type

The conditions The file size is a specific range kilobytes and The file type is a specific type are available only when your workflow is associated with a Library or the Document content type.

The file size is a specific range kilobytes

This condition is initially displayed in a workflow step as If the file size is between size and size kilobyte. It checks if the file size of a document is between the specified sizes, in kilobytes. The condition does not include the specified sizes in the evaluation. You can enter a number or use a lookup for the first or the second size in the condition.

Following is an example of what the condition might look like in a workflow step,

If the file size is between 1023 and 1048577 kilobytes

Note A file that is 1023 KB would evaluate as false because it is not between 1023 and 1048577.

The file type is a specific type

This condition initially displays in a workflow step as If the file type is specified type. It checks if the file type of the current item is of the specified type, such as docx. You can enter the file type as a string or use a lookup.

Following is an example of what the condition might look like in a workflow step,

If the file type is docx

Top of Page Top of Page

Conditions available within a Site workflow

Site workflows operate at the site level and are not associated with a list item. When you are working in a site workflow only the following conditions are available. All other conditions in SharePoint Designer 2010 operate on list items, and therefore do not apply to a site workflow.

  • If any value equals value
  • Person is a valid SharePoint user

From within and impersonation step in a site workflow:

  • Check List Item permissions
  • Check List Item permission levels
  • Person is a valid SharePoint user

For more information about conditions, see the General Conditions section of this article.

Top of Page Top of Page

 
 
Applies to:
SharePoint Designer 2010