Code to store data in repeating fields - InfoPath Dev
in

InfoPath Dev

Code to store data in repeating fields

Last post 11-09-2010 05:17 AM by sukumarsb. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-19-2010 04:40 AM

    Code to store data in repeating fields

     

    Hi i am a newbie to infopath, i have developed a form which has fields in repeating  section.Now can any one give me an idea about how to store these repeating field data in list.I have tried doing it but only the recent value gets stored i.e if i enter 2 datas only the recently entered data gets stored.can anyone help me with the idea and with the code to do it.

    Thankyou in advance
  • 10-19-2010 07:32 AM In reply to

    Re: Code to store data in repeating fields

    Hi, you can make a loop on your repeating field and save each value on another field with a separator and publish this field to Sharepoint.
  • 11-07-2010 10:55 PM In reply to

    Re: Code to store data in repeating fields

     Hi Potemkine, thanks for ur reply.Can u plz help me out with code for the idea u gave.I tried many methods but couldn succeed.Plz help me out with the code

  • 11-08-2010 12:37 PM In reply to

    Re: Code to store data in repeating fields

    Hi, no problem, the idea is to publish a different field with all your repeating value concatenante on this field. You have to use your own Xpath. You can use this code on publish for exemple.

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

    string title="";
    // Loop through the rows of the repeating table
    while (rows.MoveNext())
    {
    // Retrieve the title
    title += rows.Current.SelectSingleNode("my:title", NamespaceManager).Value+ ";";
    }
    //set another field with Title value
    root.SelectSingleNode("/my:myFields/my:Other_row", NamespaceManager).SetValue(title)

    On my sample you have to publish Other_row on Sharepoint.

    Hope it's help!

  • 11-09-2010 05:17 AM In reply to

    Re: Code to store data in repeating fields

     Thanks a lot!!!! it worked great

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