Populate a repeating table based on values of a secondary datasource. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populate a repeating table based on values of a secondary datasource.

Last post 06-18-2009 01:16 PM by Midianman. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-18-2009 11:45 AM

    • Midianman
    • Not Ranked
    • Joined on 03-09-2009
    • Elkton, MD
    • Posts 5

    Populate a repeating table based on values of a secondary datasource.

    I have a dropdown that is populated by a secondary datasource.  This works fine.  I want to be able to select a value from the dropdown and populate a repeating table of my main based on values from another secondary datasource.

    I can set rules on my dropdown that set the indivdual fields of my repeating table and only received the first record.  After some reading thought th

    I then added a filters to the fields from within the repeating table and I got the same results, only the first record.

    So I tried dragging over the group from the secondary datasource which brought over all of the fields from the secondary datasource and bound it to it.   This causes 2 problems.  One everything is grayed out under the data tab, so I can not filter it.  secondly since it is unfiltered the form tries to bring in too much data on the load and hangs.

    My xpath looks like the following where VwReservationDetails is the secondary datasource and it will bring in the first record fine. 

    xdXDocument:GetDOM("VwReservationDetails")/dfs:myFields/dfs:dataFields/d:VwReservationDetails/@PART_ID[../@RES_ID = xdXDocument:get-DOM()/my:myFields/my:Request_No]

    Part_no is the field inside the Material_transfer group in Main being field populated with PART_ID from  VwReservationDetails
    where RES_ID from the VwReservationDetails is equal to the Request_No (dropdown on the form) 

    I am guessing I need to include the group on the form somehow but I am not sure how and if this works how would the fields get there mapping:

    /my:myFields/my:Material_Transfer

     

    Jester of all trades, serious in none.
  • 06-18-2009 11:54 AM In reply to

    Re: Populate a repeating table based on values of a secondary datasource.

    Actually, what you tried should, so maybe you got one part wrong.  The way I would do this is to drag the group from the whichever data source will populate the repeating table and put it on the canvas.  Remove whichever fields you don't want in the table and move around/format the columns to look how you want.

    Then, double-click the repeating table to get to its properties and go to conditional formatting.  In there, choose to HIDE THIS CONTROL if the field in the data source matches the data chosen in your other dropdown.  That will cause the repeating table to only show the data relevant to the selection.  However, the form will still download all the data.

  • 06-18-2009 01:16 PM In reply to

    • Midianman
    • Not Ranked
    • Joined on 03-09-2009
    • Elkton, MD
    • Posts 5

    Re: Populate a repeating table based on values of a secondary datasource.

    Awesome thanks!!!

    Dragging the secondary datasource to my form and using the conditional formatting resolved the data display issue.  Now I just need to figure out a way to get only the displayed records to merge and publish to the list as well.

    It appears as though there is no way to publish to the list from the secondary datasource.   I assume I have to copy the data displayed from the secondary datasource to a repeating table in my main.  Is that correct?

     

    Jester of all trades, serious in none.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.