Copy repeating table to another table - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Copy repeating table to another table

Last post 03-16-2022 07:10 AM by hainh1984. 18 replies.
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts: Previous Next
  • 12-30-2011 12:23 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Copy repeating table to another table

    I've read forums about this topic and realize qRules might help me but my question is theory for now.  I am not sure how I want to approach the problem which is:

    I have a travel form with several views; two are almost identical, the Estimated Costs page (before travel) and the Actual Costs page (after travel).  Initially I want all the values from the original (estimated costs) repeating table containing estimated costs by day/row to appear on page load of Actual Expenses page but I also want the ability to change the values on Actual Expenses and not have them reflect back to Estimated Expenses page.  I have tried creating a secondary repeating table and setting default values from those in original table but only the first row of data appears.

    If I can copy original repeating table to secondary repeating table, will editing done later in the secondary table, filter back to original repeating table?  I don't want it to.  What is the best way to handle my problem?

    Filed under:
  • 12-30-2011 12:34 PM In reply to

    Re: Copy repeating table to another table

    I wonder - what about having a single repeating group. It has a field for Actual Cost and a field for Estimated Cost. One table shows the Estimated Cost field, another shows the Actual. The default for the Actual is the estimate.

    I've attached a quick sample - right click the link in the post header and save the file locally. Right click the saved file to open in design mode and from there you can preview and try it out. The two tables could be in different views, inside conditionally formatted sections, or otherwise tweaked to only show one table at a time if you wished.

    Hilary Stoupa

  • 12-30-2011 01:55 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    Wow!  I think that will work.  I have several columns and it means re-working the original table, but it's a great no-code option and will save me tons of time in the long run!  Thank you ~I didn't know I could use the same repeating table with different fields.

    I am curious about copying repeating tables programmaticaly though - if I did that, would I be able to change the values in the copied table without affecting the original table.?  Oh I think I know the answer....as long as the values are copied into different fields, the answer is yes.

    Doreen

  • 12-30-2011 02:19 PM In reply to

    Re: Copy repeating table to another table

    That's right -

    It is kind of a hard concept at first, but in InfoPath, the data source and the controls are two separate things. The control is bound to a data source field, but that doesn't mean other controls can't be bound to the same data source field.

    So, you could have two repeating groups, and programmatically copy data from one to another. If data changes in the first group, unless you have logic (rules, defaults, code) in place to change the data in the second group, the second group's data will stay as it was when you populated it.

    On the other hand - as in my sample, where there are two controls bound to the same group, you'll notice when you add rows to the first table, you see them in the second table as well - that is because new nodes are being added to the repeating group the table is bound to.

    Hope that helps clarify a little bit?

    Hilary Stoupa

  • 01-03-2012 01:03 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    One more question ....I have checkboxes in my original repeating table.  Is it possible to populate the secondary checkboxes with values from original by default?  Is yes, how?
  • 01-04-2012 04:29 AM In reply to

    Re: Copy repeating table to another table

    Based on the prior posts in this thread, it sounds like you are displaying the same repeating group in two different table controls.  If so, then you can just display the same field as checkboxes in both tables.  Am I missing something?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-04-2012 10:05 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    That is correct.  The problem I face is there doesn't seem to be a way to set a default value in the secondary checkboxes based on values (True/False) from the first set of checkboxes.  With a textbox field, I can set the default value.

    The reason I don't want to use the original checkboxes is because I don't want to alter the original repeating table (checkboxes) in any way.  I want them to remain with the original selections.  Initially I want their values to populate my secondary repeating tables fields and checkboxes and this is doable with textbox fields but not with checkboxes it seems?

  • 01-04-2012 11:47 AM In reply to

    Re: Copy repeating table to another table

    Please try modifying the field's properties instead of the control's properties.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-04-2012 12:58 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    I don't understand what you mean.  I do have an "update" button where I have attempted to set the checkbox value to True if the orginal checkbox value is True but the checkmark doesn't appear in the box.  I get a faint red box around the checkbox and the checkbox essentially becomes read only so that I cannot change the selection which is a must.  I suppose the only thing to do is to show the original checkboxes along side the new checkboxes so the user can see what was chosen before and check them again....it makes the form a little busy.

  • 01-04-2012 10:29 PM In reply to

    Re: Copy repeating table to another table

    You said you're using a default value formula to have some textbox values match the values of other fields.  You can do the same thing with these checkbox fields; you just need to do it in the fields' property dialog rather than the checkbox controls' property dialog.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-05-2012 11:44 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    I found my answer in a post by Hilary.  I was setting checkbox control to "TRUE" when it should be a function "true()" instead.  Very simple. Her example was all I needed to see.

    http://www.infopathdev.com/forums/t/13376.aspx

    Thank you Jimmy for your replies.  I appreciate your persistence with me.

  • 07-24-2012 01:50 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy repeating table to another table

    Hi Hilary,

    I didn't notice this until now, but when I change the value of the actual field in the 2nd repeating table, save it, then reopen the form, the actual value reverts back to the estimated value.  Oops.  Any ideas on how to make it stick?.

  • 07-24-2012 02:05 PM In reply to

    Re: Copy repeating table to another table

    If you are using default values, you may want to deselect the option to refresh the default if the values involved change (in the field properties). If this doesn't give the result you want, you may want to use rules instead of default values.

    Hilary Stoupa

  • 03-07-2022 12:18 AM In reply to

    Re: Copy repeating table to another table

    Hilary Stoupa:

    If you are using default values, you may want to deselect the option to refresh the default if the values involved change (in the field properties). If this doesn't give the result you want, you may want to use rules instead of default values.

    Hi, Can you please help to check this form. As I try to do it many ways to get seperate data, but it not work
  • 03-07-2022 09:08 AM In reply to

    Re: Copy repeating table to another table

    Can you give me a bit more info on what you are trying to do? Thanks!
    Hilary Stoupa

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