Professional Documents
Culture Documents
com Page 1 of 7
We will then map these fields onto our SharePoint list which also has three columns:
1. 2. 3. 4. 5. 6.
Launch InfoPath to SharePoint List Tool and go to the Define Mapping tab: In the Source XSN field, attach the InfoPath form template (XSN). Enter the root SharePoint site in the Target SharePoint Site URL field, e.g. http://SharePointSite Click on the Get SharePoint Lists button. In the SharePoint Lists dropdown, select the list you wish to submit items to, in this case, My Renamed List. Click on the Extract Schemas button.
www.qdabra.com Page 2 of 7
7. 8.
Since were using a repeating group in our form, we will have to check the box Data is from repeating group in the Mapping Definition section. Click on the icon to display the Schema Tree taskpane and select the repeating group for your data, which in this case is my:myFields/my:group1/my:group2
9.
Click on the icon in each Form Field row to select the fields from the Schema Tree taskpane, and then select the corresponding SharePoint Column to map the fields to.
10. When done mapping, click on the Save As qRules Mapping button. 11. Save the mapping as an XML file in your local drive. In this example, we will leave the default name as mapping.xml, although we can use any filename. 12. Once done, close the tool and open the form template in InfoPath Design mode. 13. Go to Tools > Data Connections and add a receive data connection. 14. Select XML document as the source of your data and browse to the mapping.xml file thats been saved in Step 11. 15. Leave the default to include the data as a resource file in the form template and allow automatic retrieve on form open. For simplicity, we will call this data connection mapping. 16. Add another data connection that submits data to a Web Service since SharePoint uses a web service for the list methods. The URL should be: http://SharePointSite/_vti_bin/lists.asmx where <SharePointSite> is the root site where the SharePoint list is.
www.qdabra.com Page 3 of 7
18. For the listName parameter, select the ListCollection node from the mapping secondary data source:
www.qdabra.com Page 4 of 7
19. For the updates parameter, select the Batch group node:
20. Select to include the updates parameter as an XML subtree, including selected element:
www.qdabra.com Page 5 of 7
21. We will name this data connection as ShPSubmit. 22. Add a rule to the Submit button to set the value of the QdabraRules Command field into SubmitToSharePointList /submit=ShPSubmit /mapping=mapping /id=my:id Note: When specifying the /id parameter and the data is from a repeating group, it should be the relative XPath to the ID field in the form. If an xpath is not found, the column in SharePoint will be blank.
www.qdabra.com Page 6 of 7
23. Finally, in Preview mode, try submitting new list items by filling out the Title and the Value fields and clicking Submit. You should see that the item gets submitted to the SharePoint list it has been mapped to and returns the list item ID back in your form.
www.qdabra.com Page 7 of 7 To update the existing items in the SharePoint list from the InfoPath form, enter the list item ID and the new values, then re-submit. Both the SubmitToSharePointList command and the InfoPath to SharePoint List Tool will not work with attributes. The fields you are trying to submit to SharePoint need to be elements.