InfoPath – Update Existing SharePoint List Item Programmatically Using CAML
Create secondary data connections in an InfoPath form to retrieve the CAML template from an XML file, then submit using a second data connection to the Lists web service on the SharePoint site containing the list being updated. The CAML template uses the UpdateListItem function from the web service to update an existing item in a SharePoint list.
This article demonstrates how to programmatically update a SharePoint list item from an InfoPath form using a CAML query to the Lists web service of the SharePoint site. The example uses secondary data connections to retrieve the CAML template from an XML file and another to submit the CAML template to a SharePoint web service using the UpdateListItem function.
The process is broken down into the following components, which are explained in detail in the article linked above.
1. Create Initial InfoPath Form
2. Set up the CAML query
3. Set up InfoPath Data Connections
4. Set up the Form Template and Required Code
Optional Steps and additional information:
- Update Repeating Field elements in the CAML Template Programmatically
- How to Submit using a Secondary Data Connection in InfoPath
Update Existing SharePoint List Item
Related posts:
- InfoPath – Update Repeating Elements/Nodes in a Secondary Data Source
- InfoPath SharePoint Integration
- InfoPath – CAML Date Time format in when submitting to a SharePoint list via a Web Service
- SPD Workflow Issue Solved – List item not found error when finding item using metadata value
- InfoPath Web Services instead of SharePoint list Data Connections