Welcome to KnowledgeLink - The AKG Blog

SharePoint Designer 2010 Workflows - the Define Workflow Lookup Dialog box

Posted by Sue Hernandez on Tue, Sep 13, 2011 @ 13:09 PM

The “Define Workflow Lookup” dialog is one of the most potentially confusing dialog boxes while using Workflows in SharePoint Designer 2010. It is used, for example, when you are comparing any value to any value in a condition, doing a variable or list lookup to set a variable's value, or after a Task operation to copy or compare the values resultant from that task.

Define Workflow Lookup Dialog Box

This dialog works very much like a SQL Select statement:

SELECT [Assigned To] FROM Tasks WHERE Tasks.ID = 2

Let’s go through the different parts of this dialog.

Data Source

There are several choices you can use for the first dropdown box in the “Define Workflow Lookup” dialog. Using our SQL Statement analogy, these are like the tables that you choose from:

SELECT [Assigned To] FROM Tasks WHERE Tasks.ID = 2

  • Current Item
    This choice allows you to retrieve values from the columns in the list you’re running the workflow on, and specifically on the very item that the workflow is currently running on. Selecting this choice will keep the dialog short and only ask you for the field you want to return, and how to return the field.
  • Workflow Variables and Parameters
    If you have any Initiation Parameters or Variables in which you have data stored, this is where you would retrieve that information. . Selecting this choice will keep the dialog short and only ask you for the parameter or variable you want to return, and how to return it.
  • Workflow Context
    This choice allows you to choose Association information about the workflow, such as who associated the workflow with the list, and whether to start the workflow on Item Creation or Item Change. You can also choose some information about the workflow, such as when it was last run, who the current user is, or what the URL is to the item or to the Workflow Status page. Selecting this choice will keep the dialog short and only ask you for the field you want to return, and how to return the field.
  • Association: History List
    This choice allows you to retrieve information from the item’s workflow history by looking directly into the Workflow History list associated with that workflow. Selecting this choice will expand the dialog and make you choose which item you want in that list by specifying a field and value to use to search for the right item.
  • Association: Task List
    This choice allows you to retrieve information from the Task list associated with that workflow. For example if you used the “Collect Data from a User” action, that would have created a task for a user; you then look at the associated Task list to retrieve that data after. Selecting this choice will expand the dialog and make you choose which item you want in that list by specifying a field and value to use to search for the right item.
  • Current List
    This choice allows you to retrieve information from the current list that you’re running the workflow on, but from an item other than the one you’re running the workflow on (Current Item). Selecting this choice will expand the dialog and make you choose which item you want in that list by specifying a field and value to use to search for the right item.
  • User Profiles
    This choice allows you to retrieve information in a user’s profile; for example, if you wanted to find a manager’s manager. Selecting this choice will expand the dialog and make you choose which person you want by specifying an Account Name (only).
  • [Other Lists and Libraries in your site]
    This choice allows you to retrieve information from any list in the same site where you’re running the workflow. Selecting this choice will expand the dialog and make you choose which item you want in that list by specifying a field and value to use to search for the right item.

Field From Source

This second dropdown in the “Define Workflow Lookup” dialog is simply the choice of the field (or parameter or variable) that you want to get from the source you chose in the first dropdown. This Field (or parameter or variable) is what is used as the return value. Using our SQL analogy, this is the field that you selected:

SELECT [Assigned To] FROM Tasks WHERE Tasks.ID = 2

Return Field As

This third dropdown is very often disabled. However I have seen it enabled, for instance, when you choose a field that represents a person. In that case you can choose to return the person in the following manners:

  • As String (comes through as ID Number and then User Name – ex: 116;#Susan Hernandez)
  • Display Name
  • Email Address
  • Login Name
  • User Id Number

Find the List Item / Field

The first dropdown in the bottom section is the field from the source you chose above that you want to use to filter out exactly which item to retrieve. In our SQL analogy, it is the field immediately after the WHERE statement:

SELECT [Assigned To] FROM Tasks WHERE Tasks.ID = 2

Find the List Item / Value

The last text box (or sometimes dropdown) is where you choose or type in the value that you want to find from the field you chose immediately above (Find the List Item / Field). Note that you can press the button to use yet another lookup to find the value to use. In the SQL analogy, it is the value that you are comparing to in the WHERE statement:

SELECT [Assigned To] FROM Tasks WHERE Tasks.ID = 2

 

~Sue

 

 

Topics: SharePoint Designer 2010, Workflow