Submit Repeating table data to Sharepoint List - InfoPath Dev
in

InfoPath Dev

Submit Repeating table data to Sharepoint List

Last post 06-25-2014 08:39 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-14-2010 08:48 AM

    Submit Repeating table data to Sharepoint List

    Hi ,

      I have a repeating table in my Infopath 2007 browser enabled form template. I need to submit the rows of the repeating table to a sharepoint list.I followed this link http://www.bizsupportonline.net/infopath2007/how-to-submit-items-rows-repeating-table-infopath-sharepoint-list.htm . It works fine if there is only i column.But I have more than one column in my repeating table .I am new to Infopath froms .Can Anyone please help.

    Thanks in advance

     Regards

    RS

  • 07-14-2010 04:16 PM In reply to

    Re: Submit Repeating table data to Sharepoint List

    First off, I have to recommend trying qRules. It has a command for this, and is much easier to use than writing your own code.

    However, to directly address your question, you'll need to add additional "field" nodes to your "batch" node for the additional columns you want to write to. May be easiest to just add that to the XML file with the CAML in it. Adjust the AddMethodNode method to include setting the values for all the field nodes.

    Hilary Stoupa

  • 07-20-2010 08:27 AM In reply to

    Re: Submit Repeating table data to Sharepoint List

    Thank You for your response.I did add additional Field Nodes and also adjusted the AddMethodNode Method.The problem is it is not giving me any error but it is not updating the list or adding the values into the list.

    here is my code

     // Retrieve the rows of the repeating table
                XPathNavigator root = MainDataSource.CreateNavigator();
                XPathNodeIterator rows = root.Select(
                "/my:myFields/my:ProbIden/my:ProbIdenvalues", NamespaceManager);

                // Loop through the rows of the repeating table
                // and construct the CAML Batch XML
                int counter = 1;
                while (rows.MoveNext())
                {
                    // Retrieve the title
                    string Action = rows.Current.SelectSingleNode(
                    "my:Action", NamespaceManager).Value;
                    string Responsible = rows.Current.SelectSingleNode(
                    "my:Responsible", NamespaceManager).Value;
                    string Target = rows.Current.SelectSingleNode(
                    "my:Target", NamespaceManager).Value;

                    // Add an item to the CAML Batch XML
                    AddMethodNode(counter, Action, Responsible, Target);

                    // Increment the counter
                    counter++;
                }

                // Submit the rows to the Lists web service to update the custom list
                DataConnections["ProbIdenSubmit"].Execute();

     

     private void AddMethodNode(int id, string Action, string Responsible, string Target)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.AppendFormat("<Method ID=\"{0}\" Cmd=\"New\">", id.ToString());
        sb.AppendFormat("<Field Name=\"Action\">{0}</Field>", Action);
        sb.AppendFormat("<Field Name=\"Responsible\">{0}</Field>", Responsible);
        sb.AppendFormat("<Field Name=\"Target\">{0}</Field>", Target);
        sb.AppendFormat("</Method>");

        XmlDocument methodXML = new XmlDocument();
        methodXML.LoadXml(sb.ToString());

        XPathNavigator secDSNav = DataSources["example"].CreateNavigator();
        XPathNavigator batchNav = secDSNav.SelectSingleNode("/Batch", NamespaceManager);
        batchNav.AppendChild(methodXML.DocumentElement.CreateNavigator());
    }

    Please Advice.

    Thanks In Advance

    Regards

  • 06-25-2014 07:59 AM In reply to

    Re: Submit Repeating table data to Sharepoint List

    HI Hillary Is Q rules something you download from Microsoft for Infopath or is it something you purchase separately? I know Infopath will not be supported by Microsoft by 2016 but if you create a tool you would think they want it to work with their other tools just makes no sense. I am having the same problem and Im not a programmer so trying to do that adding code I would need to know exactly how to add it and where. If you can give me that information I would love to try it. Thank you
  • 06-25-2014 08:39 AM In reply to

    Re: Submit Repeating table data to Sharepoint List

    qRules is a product from Qdabra, the company I work for - in my earlier post in the thread is a link to the product page.

    Hilary Stoupa

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