My form has a table that the user can add/remove rows as desired.
I am looking for a way to allow the user to copy the table mentioned above into a second, third, etc. instance. I want the subsequent instances to have the same number of rows and have the same text as entered in the first instance.
Your code will need to know how many instances the original table has so you know how many instances in the other tables to make. You will then need to make the rawValue of the target table cell the same as the original table cell. To do this you need to send the rawValue to the correct row (instance).
See this link for some information about referencing row instances directly.
Thanks for the response.
I would like the user to dynamically be able to repeat the table as many times as needed so I don't think your code in the link will work for me. Referencing your example, I would need multiple instances of Table1 - I won't have a Table2.
Another instance of Table1 would still be Table1, but be referenced using an instance parameter Table1. For Example:
Instead of having this.resolveNode("Table1.Table1.Row1.TextField1").rawValue = "text in third instance";
you could easily have
this.resolveNode("Table1.Table1.Row1.TextField1").rawValue = this.resolveNode("Table1.Table1.Row1.TextField1").rawValue;
This would put the value in the textfield in the original instance into the same field in the third instance. You could shorten the code by counting instances and using a variable or you could just write a very long code accounting for a maximum number of subform instances.
Does that help?
Thank you! This helps - I am getting closer.
I can now add a second instance of Table1 with the same number of rows as the first instance.
I think I will need two loop functions or nested loop functions: Copy text fields from the first table instance to x table instance for y number of rows
Glad to have helped out.
Loops are not my thing, but if you search the forum you should be able to find some examples. The LC help is rather lacking when it comes to loops.