none
Parent-Child relationship retrieves only first row of data in InfoPath repeating table

    Question

  • Hello, I have two SharePoint lists: Job (Parent) and Job Items (Child); there is a one to many relationship between the Job and the Job Items. I am trying to populate a repeating table with info from the Child list based on the Job Number of the parent. I am using rules on my repeating table to set the value of the fields based on a filter that checks if the Job number of the parent equals the Job number of the Child. The problem that I have is that i get only the first row back. How can I get all the rows of the Child table when they all match a Job Number and populate the repeating table? Thank you

    ITGirl

    Monday, August 25, 2014 7:13 PM

Answers

  • Hi,

    To get the related items from the Child list in the repeating table, I recommend to formatting rules to display the corresponding items from Child list.

    Here are the detailed steps:

    1.  Create a blank form in InfoPath and add the Parent list and Child list including all the fields you need as external data sources to the form.

    2.  Insert a Drop-Down List Box in the blank form called field1 and set it to get value from the Job number field in Parent list(remember to select ID as value).

    3.  Choose the secondary data source of Child list added in step1 in Fields panel and then expand dataFields, then right click d:SharePointListItem_RW and select Repeating Table to insert the secondary data source of Child list as repeating table to the form.

    4.  Right click d:SharePointListItem_RW in the Fields panel and select Rules, then click New and select Formatting in Rules panel.

    5.  Click None under Condition in Rules panel, then select Job number field in the repeating table in the first box, select is not equal to in the second box, then choose Select a field or group in the third box and select Main under Fields, then click the field in the form and then click OK.

    6.  Select Hide this control under Formatting in Rules panel.

    Best regards.

    Thanks


    Victoria Xia
    TechNet Community Support

    • Marked as answer by ITGirl Tuesday, August 26, 2014 5:51 PM
    Tuesday, August 26, 2014 9:17 AM
    Moderator

All replies

  • Hello, I have two SharePoint lists: Job (Parent) and Job Items (Child); there is a one to many relationship between the Job and the Job Items. I am trying to populate a repeating table with info from the Child list based on the Job Number of the parent. I am using rules on my repeating table to set the value of the fields based on a filter that checks if the Job number of the parent equals the Job number of the Child. The problem that I have is that i get only the first row back. How can I get all the rows of the Child table when they all match a Job Number and populate the repeating table? Thank you

    ITGirl

    Monday, August 25, 2014 7:14 PM
  • This may help: http://blogs.msdn.com/b/infopath/archive/2004/09/13/228881.aspx

    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

    Monday, August 25, 2014 9:10 PM
  • Hi,

    To get the related items from the Child list in the repeating table, I recommend to formatting rules to display the corresponding items from Child list.

    Here are the detailed steps:

    1.  Create a blank form in InfoPath and add the Parent list and Child list including all the fields you need as external data sources to the form.

    2.  Insert a Drop-Down List Box in the blank form called field1 and set it to get value from the Job number field in Parent list(remember to select ID as value).

    3.  Choose the secondary data source of Child list added in step1 in Fields panel and then expand dataFields, then right click d:SharePointListItem_RW and select Repeating Table to insert the secondary data source of Child list as repeating table to the form.

    4.  Right click d:SharePointListItem_RW in the Fields panel and select Rules, then click New and select Formatting in Rules panel.

    5.  Click None under Condition in Rules panel, then select Job number field in the repeating table in the first box, select is not equal to in the second box, then choose Select a field or group in the third box and select Main under Fields, then click the field in the form and then click OK.

    6.  Select Hide this control under Formatting in Rules panel.

    Best regards.

    Thanks


    Victoria Xia
    TechNet Community Support

    • Marked as answer by ITGirl Tuesday, August 26, 2014 5:51 PM
    Tuesday, August 26, 2014 9:17 AM
    Moderator
  • Thank you Victoria, your approach worked for me. I have one last question, I need to show the "Insert Rows" button for users to add additional rows if needed but it is grayed out in the repeating table, Is there a way to make it visible?

    


    ITGirl


    • Edited by ITGirl Tuesday, August 26, 2014 5:58 PM
    Tuesday, August 26, 2014 5:51 PM