Thursday, February 20, 2014

Understanding the SharePoint Designer Workflow Lookup Dialog

If you have ever designed a workflow in SharePoint Designer, you may find that using the text-based designer can be very confusing.

Many of the actions are straight forward, while other dialogs are downright confusing and confounding.

Among one of the most confusing dialogs in SharePoint Designer happens to be the Lookup Dialog.  The wording on the dialog itself is extremely difficult to understand.  Even worse, this dialog is extremely poorly documented on MSDN as well as in numerous SharePoint books.  Very few books go into depth on exactly how to use and leverage this dialog in your SharePoint Designer workflows.

One uses the Lookup Dialog in SharePoint Designer when attempting to lookup a field value from a list and then subsequently use that value such as by assigning it to a Workflow variable.

Below is a screenshot of the Lookup Dialog:

Basically, the Lookup Dialog needs information to "lookup" from a specific List and Column.  In addition, the Lookup Dialog needs to be able to determine how to find the specific record or row in the List which you are targeting for the lookup.  By far, the most confusing aspect of this dialog is definitely the "Find the List Item" section which has befuddled and confounded me for many years based on the wording provided in the dialog.  The "Find the List Item" section can essentially be considered as the "where clause" of the Lookup query.

Field Data to Retrieve
  • Data source: This refers to the List from which you wish to retrieve information
  • Field from source: This refers to the specific column that you wish to retrieve from the List
  • Return field as: This specifies the data type or the format in which the data from the List will be returned

Find the List Item
  • Field:  This refers to finding the specific record or row in the List.  In nearly all cases, you will need to use a unique identifier for the row or record which is usually a Guid or an ID.
  • Value:  Since you are usually working with triggering a workflow on a specific record or row in a List, you will want to find the Current Item's ID.  This row is the one that was used to specifically trigger the workflow that is running.

I hope this dramatically improves your understanding of this particularly poorly worded and constructed dialog in order to help you better design and develop workflows in SharePoint Designer.

Good luck!!

1 comment: