Update Existing SharePoint List Item via Web Service & CAML from InfoPath - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Update Existing SharePoint List Item via Web Service & CAML from InfoPath

Last post 07-18-2017 07:53 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 08-04-2009 07:10 PM

    • Daniels
    • Not Ranked
      Male
    • Joined on 07-28-2009
    • Melbourne, Australia
    • Posts 18

    Update Existing SharePoint List Item via Web Service & CAML from InfoPath

    How to Update an Existing SharePoint list item using a CAML Query to the SharePoint Lists web service from an InfoPath form.

    The major steps involved are:
    1. Create Initial InfoPath Form
    Create the initial form template, main data source and retrieve the required details from the SharePoint list

    2. Set up the CAML query
    Create the CAML query using U2U for assistance with field identifiers.  Additional information is provided about column identifiers for SharePoint lists in CAML queries in the post InfoPath CAML - SharePoint column identifiers.  If you are updating Date/Time fields (or others which require a specific format) in the SharePoint list, you may find that the CAML query is not updating the SharePoint list item.  If the format of a date/time value in a CAML template is incorrect, the update will not take place and any reamining updates will also be ignored.  For details about the required date/time format when updating the time component in a SharePoint date/time field, see InfoPath - CAML Date Time format in when submitting to a SharePoint list via a Web Service.

    3. Set up InfoPath Data Connections
    Set up the data connections required to retrieve the blank CAML template from an XML file and another to subit the data back to SharePoint to update the existing SharePoint list item.

    4. Set up the Form Template and Required Code
    Set up the template to populate the CAML template with the required values, the submit programmatically using the secondary data connection.

    Optional Steps and additional information:

    Update Repeating Field elements in the CAML Template Programmatically
    This can be useful when you need to set values in the CAML template without displaying a full repeating table with controls.  As the CAML template has a repeating "Field" element for eacch field in the SharePoint list that requires updating, you can loop through each element to find the one where the name attribute matches the required.

    How to Submit using a Secondary Data Connection in InfoPath
    Submitting using Secondary data connections can be useful when you need to submit to multiple locations, or only submit to specific data sources based on form criteria and rules.  To do this, secondary data connections can be set up for each required destination, which can then be executed individually using rules attached to form fields and controlls or programmatically.

    For full details and additional notes/troubleshooting, see InfoPath - Update Existing SharePoint List Item Programmatically Using CAML.

    Blogs:
    SharePoint Admin & Dev - SharePoint and InfoPath Development

    Web Development & Programming - Php, C#, .NET Framework, SEO Tips

    WebmasterHub.net - Free SEO, Webmaster Resources
  • 08-06-2009 09:30 AM In reply to

    Re: Update Existing SharePoint List Item via Web Service & CAML from InfoPath

    Thanks for the outline!

    Hilary Stoupa

  • 10-30-2013 08:37 AM In reply to

    • gins1
    • Not Ranked
    • Joined on 10-30-2013
    • Posts 1

    Re: Update Existing SharePoint List Item via Web Service & CAML from InfoPath

    Thank you for these posts, they have been very helpful to address a need for my client. I have this working perfectly in the Preview mode on my desktop, however, when published, the browser form does not update the SP list & provides no errors. Any ideas on why? Thank you in advance.
  • 07-17-2017 06:31 PM In reply to

    Re: Update Existing SharePoint List Item via Web Service & CAML from InfoPath

    Hi, I have followed all the steps carefully, however the data connection is not submitting data to my SharePoint site, even though no error is shown. CALM is verified, GUID is correct, connection is well set up. Have you come across a case like this? I am using SharePoint 2013 and InfoPath 2013. Regards,
  • 07-18-2017 07:53 AM In reply to

    Re: Update Existing SharePoint List Item via Web Service & CAML from InfoPath

     You are 100% sure you have the right field names in your CAML? Perhaps try just setting the Title field to start, comment out the other fields, and see what that gets you.

    Hilary Stoupa

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.