Monday, February 3, 2014

InfoPath 2010 & SharePoint 2010 Repeating Table Pulling The Wrong Information Based Upon Combo Box Order Selection

Hello!

This issue was extremely hard to tag for a blog post, but essentially the Repeating Table displays correctly only when selecting items in reverse order of the dropdown i.e. selecting Choice 3, Choice 2, and Choice 1in that order pulls over the correct information.  If I were to select Choice 3, Choice 1, & Choice 2 the information would not query correctly.

The issue is actually a result of your rule which pulls in the additional information.  In my example, I have used a repeating table to select multiple products to one purchase order.  If you select the items in the incorrect order the SKU & Price will query incorrectly.  For my setup, I have a price list which drives my Material Description list box, which then pulls over the corresponding SKU & Price.

(note: this screenshot encompasses the fixed XPath rule)

To Fix This Issue:

You will need to update the XPath of the rules you created to pull over your other fields (mine being SKU & Price).

      Open your rule which sets the values of the other fields
     Open your set a fields value parameter
a.    
Select the insert function button (fx)
Select Edit XPath
a.    
Your original rule most likely will resemble the following:
a.    xdXDocument:GetDOM("Price List")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Part_x0020_Number[../d:Title = xdXDocument:get-DOM()/my:myFields/my:group1/my:group2/my:Material]

      Update the last parameter of the rule “Title = …” to current()

a.    xdXDocument:GetDOM("Price List")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Part_x0020_Number[../d:Title = current()]

This will resolve your issue and enable you to select from your dropdown in any order and still pull the correct details for your fields that you are setting.



Cheers!

Dan