20.3. Using Conditions in Workflow Designer

Workflow Designer allows you to work with a number of conditions for setting up branching in a workflow based on the if/else logic. Essentially, this means that based on the result of the condition, the workflow can be branched to perform different operation for each result. Internally, if you review the XOML file created for the workflow, you see that all these conditions are actually rules-based conditions (defined in the .xoml.rules file) used by the IfElseActivity activity.

NOTE

SharePoint Designer workflows in the current release aren't capable of looping through the actions. This means that you can't emulate a For-Loop or a Do-While logic by using SharePoint Designer workflows.

20.3.1.

20.3.1.1. Compare List/Library field

Defined by the description "If field equals value," this condition can be used to compare a field in the SharePoint list or library with a constant or a value from anther field or workflow variable. The description has three hyperlinks:

  • Field: This is a dropdown menu that can be used to choose any of the fields/columns in the list of library.

  • Equals: Shows a dropdown menu that can be used to choose an operator for the comparison. The dropdown menu has the following operators: equals, not equals, is empty, is not empty, begins with, does not begin with, ends with, does not end with, contains, does not contain, matches regular expression, equals (ignoring case), and contains (ignoring case).

  • Value: This can be used to set a new value or choose from a list of existing values (for example, in case of a choice column). Alternatively, you can use the Define Workflow Lookup dialog box to choose a source and field for lookup.

20.3.1.2. Compare any data source

This condition can be used to compare any field or workflow variable with another. It's defined by the description "If value equals value." The description has three hyperlinks: value, equals, and value. The value hyperlinks can be used to look up a field or workflow variable that forms the left and right operands of the comparison. The equals hyperlink allows you to choose from a set of operators defined by the data type of the operands.

20.3.1.3. Title field contains keywords

This condition can be used to compare the Title field of the list or library with a value that can be manually set or chosen via the Define Workflow Lookup dialog box.

20.3.1.4. Modified in a specific date span

This condition is described by using the description "modified between date and date." The date hyperlinks can be used to choose a date value, a field, or a workflow variable for the date/time data type. The condition is used to evaluate whether the current item has been modified between the dates specified by the workflow.

20.3.1.5. Modified by a specific person

This is defined by using the description "modified by a specific person." This condition is used to find out whether the current item has been modified by a specific person. The specific person hyperlink in the condition's description allows you to specify the user that needs to be used for the comparison. To choose the user for the condition, you can use the Select Users dialog box, as shown in Figure 20.21. The Select Users dialog box can be used to select a single user or group for use in the condition.

While the Select Users dialog box allows you to choose from the existing SharePoint site users, you also can locate contacts from an address book, look up data using the Define Workflow Lookup dialog box, or use the user who created the current item.

NOTE

As the description suggests, the previous conditions can be used to match only a single user or SharePoint Designer group. You can't choose to have the conditions met with multiple users or groups.

20.3.1.6. Created in a specific date span

Similar to the Modified in a specific date span condition, this condition can be used to check if the current item has been created between the specified dates. The description "created between date and date" has hyperlinks that allow you to specify dates for the comparison.

Figure 20.21. Selecting a user for a condition by using the Select Users dialog box

20.3.1.7. Created by a specific person

Similar to the Modified by a specific person condition, this condition allows you to find out if the current item has been created by a specific person.

NOTE

For more on how these conditions can be used to design complex workflows in Workflow Designer, see Chapter 22.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.247.68