Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data - InfoPath Dev
in

InfoPath Dev

Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

Last post 10-28-2010 10:11 AM by FSYR2010. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 10-27-2010 11:39 AM

    Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    I have an Infopath 2007 form that has a repeating table.  I also have a secondary data connection receiving data from a Sharepoint List.  This list contains our office supplies (description, bin number, stock number).  My repeating table has all three of these fields. I want to set it up so that when a user fills out the form, all they have to select is the Item Description and the Bin Number and Stock Number automatically pull in from the Sharepoint List.  I have rules setup on the Item Description field so that when a user selects the Item Description the Bin/Stock Number is filtered and only display the number corresponding to the Item Description that matches the ID of the Item Description in the Sharepoint List.

    When I test it out, the first row of the repeating table works perfectly.  However, when if I insert more rows and select a different Item Description the Bin and Stock Numbers on the new row are the same as the first.  Any ideas?

  • 10-27-2010 12:42 PM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    Hi, and welcome!

    You need to add a filter to the data values for your rules. Your rule is set on your main data source description field, right? And the rule sets the value of bin number (for example) to the bin number from the SharePoint list. But when you select that bin number from the SharePoint list data source, you need to add a filter to it. There's a button in the dialog that you select a field from that says filter data. In this case, your filter would be where the item description in your main data source is equal to the item description in the SharePoint list.

    For more on filtering, this Office Online article may be a good place to start.

    Hilary Stoupa

  • 10-27-2010 12:53 PM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    Yes, the rules are set on the main data source Item Description field.  And I already have a filter set on that rule.  The rule sets BinNumber (main data source) to the value (using a formula) @BIN_NUMBER[@ID = ItemDescription].  Unless I'm thinking wrong, this formula should set BinNumber (main data source) to BIN_NUMBER (secondary data source) and filter out everything except when ID (secondary data source) equals ItemDescription (main data source).

    I should also mention, in the ItemDescription field (main data source) properties I have it set so that the Value is @ID, but the Display Name is @DESCRIPTION.

  • 10-27-2010 01:02 PM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    It sure looks from your description like you have this set up right.... Are you using InfoPath 2003 by any chance? Because if the filter isn't using current() to get the correct ItemDescription, that could be your problem, and as I recall, IP 2003 could be a bit flaky. Try this -- in the formula dialog, select edit XPath, and paste the results in a reply...

    Hilary Stoupa

  • 10-27-2010 01:05 PM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    It's InfoPath 2007.  Here's the XPath:

    xdXDocument:GetDOM("OfficeSupplies")/dfs:myFields/dfs:dataFields/dfs:Office_Supplies/@BIN_NUMBER[../@ID = xdXDocument:get-DOM()/my:myFields/my:ItemsRequested/my:Item/my:ItemDescription]

  • 10-27-2010 01:58 PM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    Try this instead:

    xdXDocument:GetDOM("OfficeSupplies")/dfs:myFields/dfs:dataFields/dfs:Office_Supplies/@BIN_NUMBER[../@ID = current()]

    Hilary Stoupa

  • 10-28-2010 05:50 AM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    That did it!  Thanks!  Why would using 'current()' work and not ItemDescription though?

  • 10-28-2010 09:07 AM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    In your original XPath, the XPath is absolute. So it is starting at the very top of the tree (if you look in the data source task pane) and finding the ItemDescription node... the first item description node. Your rule, however is firing based on the change of a ItemDescription node. That makes the ItemDescription node that is causing the rule to fire the current node..... which means that your original XPath said "Compare this to the first ItemDescription node you find" and the revised XPath said "Compare this to this very particular ItemDescription node that just changed".

    For more on current() and other functions, check out this Office Online article. Search for current() to find that specific section.

    Hilary Stoupa

  • 10-28-2010 10:11 AM In reply to

    Re: Repeating Table Pulling Data from Sharepoint List Only Shows First Row Data

    Makes sense, thanks!

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