Background: MOSS 2007, SharePoint Designer 2007 used to create the workflow.
I have a user request workflow which is initiated when a new item is created in a user request list. The user is required to select a ‘location’ when submitting the form (this form is used by many different locations in the USA). Depending on the type of request an approval may be needed and I send an email to a designated approver based on the location that was selected by the user. The user doesn’t know who the approver is and the support desk staff may or may not know either. I currently am using hard-coded email addresses for the approvers in my workflow. I ‘set’ a column with the email address once it is determined in the workflow and in later steps use that field in the email message.
What I would like to do is use another list to allow us to maintain the approvers, their appropriate email address, and the location where they are allowed to approve requests.
Here is how I did it:
- Edit my workflow in SharePoint Designer (SPD)
- Navigate to the appropriate step and conditional branch.
- Modify the “Set” field line, selecting my ‘other list’ as Source in the “Lookup Details” section of the Define Workflow Lookup window (note that this window opens when you select another list in the Source drop-down).
- Select the field in that source that I want used in the user request list for the Field selection of the Lookup Details section.
- Under “Find the List Item” section, I used the other list Location column in the Field selection.
- I then used the current list Location in the Value selection
- Click OK to close the Define Workflow Lookup window.
- Click YES to the warning (if it displays) that says “The lookup that you defined is not guaranteed to return a single value.” etc.. “Do you want to continue?”
- Finish your workflow to save and close the Workflow Designer window.
- Test it out – The appropriate approver is pulled from my “approval maintenance” list and placed into the current list item in my user request list!
This took me a little effort to figure out, it isn’t clearly documented and I couldn’t find it in the SPD help. Maybe someone else will be able to use this, and shortcut their search effort to figure out how to do this kind of lookup in a workflow.