0

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?

  • May be this article will help you http://www.bizsupportonline.net/infopath2007/how-to-prefill-infopath-repeating-table.htm – notChosen Sep 28 '17 at 05:16
  • Thank you for your response. Unfortunately, this is a list form. The ability to default repeating table values is available only for library forms; not list forms. List forms let us create repeating tables bound to data connections (receive), but not to create new repeating tables from scratch or set default values for repeating tables. – rick263 Oct 03 '17 at 15:10
  • Do you know specifically what rows you want to populate? I think you can validate what row you are in and then use the rule to fill the field. But I don't know if that is enough in your case? ...update... missed your added picture :) You want to have it based on a fieldname? – M.P. Oct 09 '17 at 12:47

0 Answers0