In this post we will discuss how to autopopulate list data to a form in infopath in SharePoint 2010. Also you can check out my previous posts on:
To autopopulate data from a list to a form, we have to follow the following steps.
1. Createa custom list and insert data into the list or we can import excel data to a list.
Now open your infopath form and create data connetion with your custom list. Follow this article
to create new data connection.
3. Now place the cursor at the textbox and Add rule.
4. Then add action, give the name.
5. Now give the conditin as as below.
6. Now expand Add dropdown and choose "set field's value".
7. Click on field and choose list data connection,expand query field and then choose the column of that list from (ex.empid of list).
8. In the value field choose main data connection,expand data field and choose the field of the infopath form(ex.empid textbox of form).
9. Now expand Add bropdown again and choose Query for data and choose secondary data connection (list data connection).
10. Now again choose set data connectio from Add dropdown.
11. In the field,choose another field, then choose main data connection,expand data field (ex.dept textbox of form)
12. To set value,click on fx.Then select field or group,show advanced view,choose list data connection, then expand data field, Choose the column, Click on Filter data, Click on Add, Choose the selected "field" "is equal to" same "filedname" as left.
13. Click ok to close all dialog box.
14. Now we can set other field using the above step.
15. When user input empid, all correspoding data pf user will autopoplated from the list in the form.