Linking two repeating tables - InfoPath Dev
in

InfoPath Dev

Linking two repeating tables

Last post 04-07-2013 08:51 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-05-2013 04:55 PM

    • Dan K
    • Not Ranked
    • Joined on 04-05-2013
    • Posts 3

    Linking two repeating tables

    Hey all, new here, so please bear with me. I just started using InfoPath yesterday and was tasked with creating a new form for my department. Right now I have two independent repeating tables which I need to work together.  When the user creates a new line in table 1, I need table 2 to automatically create a new line, and I need each line's first column to be the same between the two tables. When you enter info into table 1, row 1 column 1, it'll populate in table 2, row 1, column 1; then you can add a new line, and what you enter in table 1, row 2, column 1 will be the same in table 2, row 2, column 1. I've been messing around with the master/detail relationship, but I can't quite figure out how to get this to work (of even if that's the right way to go about it). Can anyone please help me figure this out?  Thanks!

  • 04-05-2013 10:03 PM In reply to

    • Dan K
    • Not Ranked
    • Joined on 04-05-2013
    • Posts 3

    Re: Linking two repeating tables

     Ok, so after some digging I figured out a work around to the "creating new rows" problem.  I just added a button with code that will add a new row to each repeating table simultaneously.

     However, I'm having an issue with the values in column 1 still.  I set up a Rule where if the Field in Column 1, Row 1 of Table 1 ("SourceCode1") is not blank, then it'll set the value of the Field in Column 1, Row 1, Table 2 ("SourceCode2") to the value "SourceCode1". 

     Now this will work with the very first row, but when I create a second row in Table 1 and input new data into Column 1, Row 2, Table 1, it will change both Rows in Column 1, Table 2 to the new value.  I need each specific row in Table 1 to equal each specific row in Table 2.

     

    Like this:

     Table 1

              Column1

    Row 1:  X

    Row 2:  Y

    Row 3:  Z

    Table 2

              Column 1

    Row 1:  X

    Row 2:  Y

    Row 3:  Z

  • 04-06-2013 09:36 AM In reply to

    Re: Linking two repeating tables

     Hi - I have a silly question. Why do you need two tables with exactly the same information? Why not just put the same table on the form in two places?

    Hilary Stoupa

  • 04-06-2013 01:25 PM In reply to

    • Dan K
    • Not Ranked
    • Joined on 04-05-2013
    • Posts 3

    Re: Linking two repeating tables

    Hilary Stoupa:

     Hi - I have a silly question. Why do you need two tables with exactly the same information? Why not just put the same table on the form in two places?

    Hi, Hilary, I apologize, I should've been more specific with my situation. The tables include more than one column, and table 1 contains different info than table 2 except for the first column in each table, which need to be identical.
  • 04-07-2013 08:51 AM In reply to

    Re: Linking two repeating tables

    Is the form data base bound? Or is something else consuming the end XML? I guess I'd continue to say - just use one repeating group - put as many fields in it as you need - only display those you need for each table.

    However - if for some reason these really must be two separate groups - I think what I'd do is use a default value for the column in table 2 with a preceding sibling formula. I'm including a simplified sample - save it locally, right click and select design to open in design mode. field4 has a default value - it uses current() and preceding-sibling to get the right instance of field1 for each row.

    Hilary Stoupa

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