In InfoPath, use a drop down list so when you make your choice another field is populated automatically. For example:
- I choose my name, automatically another field reflects my manager’s name
- I choose a name, another field displays a number, an ID…
- I choose a town, another field displays a mileage for expenses
- I choose a product, a price displays elsewhere in my order form
Thanks to http://www.bizsupportonline.net/infopath2007/how-to-vlookup-infopath-look-up-data-sharepoint-list-rules-filters.htm
- In SharePoint, ensure that you have a Contacts SharePoint list that you can use. This list must contain IDs, names, and email addresses of contacts.
- In InfoPath, add a Data Connection to the Contacts SharePoint list. Ensure you select the ID, First_Name,Last_Name, and E-mail_Address fields from the SharePoint list when creating the data connection.
- Add a Drop-Down List Box control to the InfoPath form template and bind it to the data connection for the SharePoint list. Set the @ID of the contact to be the Value of an item in the drop-down list box and set the@Last_Name of the contact to be the Display name of an item in the drop-down list box.
- Name the Drop-Down List Box control contact.
- Add a Text Box to the InfoPath form template and name it lastname.
- Double-click the Drop-Down List Box control to open its Properties dialog box.
- On the Drop-Down List Box Properties dialog box, click Rules.
- On the Rules dialog box, click Add.
- On the Rule dialog box, click Add Action.
- On the Action dialog box, leave Set a field’s value selected in the Action drop-down list box.
- On the Action dialog box, click the button behind the Field text box.
- On the Select a Field or Group dialog box, expand all of the nodes, select the lastname node, and clickOK.
- On the Action dialog box, click the button behind the Value text box.
- On the Insert Formula dialog box, click Insert Field or Group.
- On the Select a Field or Group dialog box, select the Contacts SharePoint list (= Secondary data source) from the Data source drop-down list box, expand all of the nodes, select the Last_Name node, and clickFilter Data
- On the Filter Data dialog box, click Add.
- On the Specify Filter Conditions dialog box, select ID from the first drop-down list box, select is equal tofrom the second drop-down list box, and select Select a field or group from the third drop-down list box.
- On the Select a Field or Group dialog box, select the Main data source from the Data source drop-down list box, select the contact node, and click OK.
- On the Specify Filter Conditions dialog box, click OK.
- On the Filter Data dialog box, click OK.
- On the Select a Field or Group dialog box, click OK.
- On the Insert Formula dialog box, the formula should resemble the following:
@Last_Name[@ID = contact]
- Click OK on all open dialog boxes to close them.
- Save your work and test the form.
Now whenever you select a contact from the drop-down list box, the last name of the contact will be looked up in the data of the SharePoint list and the contact that has the same ID as the selected item in the drop-down list box will be displayed in the lastname field on the InfoPath form.
Notes:
- This solution works for InfoPath browser forms.
- This technique is not restricted to secondary data sources that are connected to SharePoint lists, but can also be used with all types of secondary data sources.
- This technique is not restricted to looking up display names in drop-down list boxes, but can be used to look up data in any other column in a secondary data source.
- This technique is not restricted to drop-down list boxes, but can be used with all types of list controls in InfoPath.