Cannot Preprocess Data for Web Service Submit To SharePoint from InfoPath

159 Views Asked by At

I recently added SharePoint web service submission functionality to a customized (InfoPath) list form (not an xml forms library form) so users could add items to another SharePoint list from the current form. Works great. Sets up repeating table from XML data connection template, and submits data to the UpdateListItems method in Lists.asmx.

List form illustration

However, users have to hand type all field values into the repeating table that is submitted to the Lists.asmx web service. I want to pre-populate some rows of the repeating table with derived values and values that come from other parts of the InfoPath form.

Several approaches I tried did not work:

  1. Created rule to set values in the Field element in the repeating table (i.e.: set Field to "myvalue"). That does not work because it populates Field element for all rows. Cannot find a way to target one row (i.e.: to set Field to “yes” where Name attribute = Field1).

  2. Added filter to rule in Manifest.xsf that sets the field value in attempt to target a specific row of the repeating table. Tried to filter with @ symbol since I’m attempting to filter on attribute (i.e: Field[@Name = "Field1"]). Also tried without @ symbol (i.e.: Field[Name="Field1"]). Neither worked as expected.

  3. Created string field to send in the submit, and used concat to assemble the XML that UpdateListItems expects. Received SOAP error message:

Seems like a simple thing to do, but cannot get it to work. Am I missing something? First thought was to code-behind, but this is a list form, not an XML forms library form (cannot code-behind in list form template).

Has anyone else successfully automatically populated some data values and submitted to SharePoint web service to add or update another SharePoint list?

0

There are 0 best solutions below