Step 3: Look up workflow participants from a SharePoint list
More information
In this step we'll configure the form to look up two additional workflow participants -- a Purchasing Manager and an Accounting Manager -- from a SharePoint list.
To do this we'll create a custom SharePoint list that will contain the Purchasing Organization and the Purchasing Manager. This will enable the form to look up the appropriate Purchasing Manager based upon the Purchasing Organization. For example, if the Purchasing Organization is in Denmark, then the Purchasing Manager in Denmark will be assigned as a workflow participant.
First, we create a Custom List in SharePoint. We'll assign this list the following properties:
|
The end result will look something like this:
We'll use the same procedure (above) to also create an Accounting Routing List, which is shown below.
Creating data connections
With the SharePoint lists for Purchasing and Accounting created, the next step is to add data connections in InfoPath from the form to the lists. Next, in InfoPath, we'll add form fields to our form for the Accounting Manager, and then configure a rule to set the accounting manager field value. The rule essentially tells the form that when the Company Code field is changed, get the accounting manager from the Company code list (i.e. the SharePoint list created earlier in this step). |
Select the the field/group to which the rule applies. | ||
Create a data filter to filter results. | ||
At right is the the resulting formula used to filter the data. | ||
This is the resulting rule details. | ||
We will finish by creating the same rule and logic, but applying it to the Purchasing Manager. |
Add participant controls and assign to swimlanes
Now we will add 2 new workflow participant controls for Accounting Manager and Purchasing Manager, and assign them to their respective swimlanes.
(See Phase 3 of this tutorial for general instructions on adding and configuring participant controls.)
See below for examples.
Accounting swimlane and participant | Purchasing swimlane and participant |
Tip: Add a section to test your form
As a final step you can add a section to your form where you can place fields (for example workflow participant fields or fields used to calculate other fields) for testing purposes. After testing is complete, you can remove this section from the view. It can be re-added and removed for debugging where necessary.
Example: To create the testing section, we'll add a field to the form with the properties shown below:
1. | Add a Section by choosing it from the list of Controls. |
| |
2. | Right-click the section, and then change the name--but then Delete the section from the view (for now). |
| |
3. | Add a Section/Group by right-clicking the myFields folder, and then selecting Add. Type a Name for the section. Next to Type, select Group. | ||
4. | Move the required fields to the new section. | ||
5. | Drag the entire section onto the form view. When you have finished testing, you can delete the section. |
If the form is getting data correctly, it should populate the test fields with the appropriate data.