InfoPath Loop in a Repeating Table

This will help you loop through a Repeating Table in InfoPath.  group2 is the name of my Repeating Table. sFunction is a function I use to check if a value has been updated in a SharePoint Library or List. If the value returned from the function does not match what I have in my drop down list, I update it with the function value.

 

Dim rootX As XPathNavigator = MainDataSource.CreateNavigator
Dim rowX As XPathNodeIterator = rootX.Select(“/my:myFields/my:group1/my:group2″, NamespaceManager)

While rowX.MoveNext
Dim sStatus As String = rowX.Current.SelectSingleNode(“my:field4″, NamespaceManager).Value
Dim sI As String = rowX.Current.SelectSingleNode(“my:field2″, NamespaceManager).Value
Dim sS As String = sFunction(sI)

If sStatus <> sS Then
rowX.Current.SelectSingleNode(“my:field4″, NamespaceManager).SetValue(sS)
End If
End While

This entry was posted in InfoPath by Ian Hayse. Bookmark the permalink.

About Ian Hayse

SharePoint Admin. SharePoint Guy. I have been working with SharePoint nonstop for the past six years. In those six years, I've done everything from 'normal' Admin work, development, migrations, training, planning, search, workflow, InfoPath, to crazy fixing of the hands-off SharePoint databases. I'm located in Austin, TX and can always help out with small projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>