Anyway to default fields of subsequent repeating table rows to match values in the first repeating row? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

Last post 12-08-2009 03:19 PM by Karthik V Mainampati. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-01-2007 11:48 AM

    Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    Hello,

    I have address information fields within multiple rows of a layout table and that layout table is in turn imbedded within a row of a repeating table.  When a user opts to add another row within the repeating table is there any way to copy those address fields or default them to match the data entered within the first row?  Or a way to use a "Same as" checkbox to accomplish the above, but only for repeating rows that are added?

  • 06-01-2007 07:21 PM In reply to

    Re: Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    If I understand what you are trying to do correctly, this is pretty easy to achieve:

    Simply double-click on each of your fields in the first row and set the default value to the same thing but specify that the first row has to be used:

    1. In the data source tree, double-click on the field of interest (for example, /my:myFields/my:data/my:row/my:address)
    2. Click on the "Fx" button next to the value textbox
    3. Check "Edit Xpath (Advanced)"
    4. Type in the xpath to the first occurance of the element (in this example this will be /my:myFields/my:data/my:row[1]/my:address)
    5. Click ok, then uncheck the "Update this value when the rest of the formula is recalculated" checkbox, ok again

    You're done! Now every time you insert a new row, it will have the same address as the one in the first row.

    Note that if you do not uncheck the checbox in step 5, the other rows will ALWAYS have the same value as the first one. This is usually not the desired behavior.

    You can find a working example here:

    http://www.infopathdev.com/files/folders/community_uploads/entry20327.aspx

    Hope it helps!

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-05-2007 01:50 PM In reply to

    Re: Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    Thanks for your help davidair.  I'll give this a try.
  • 06-05-2007 02:43 PM In reply to

    Re: Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    It worked great davidiar.  Thanks again!

  • 10-12-2007 08:41 AM In reply to

    Re: Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    I tried this out and it works great.  Except now I would like to have the end row be the row that is cloned.  So instead of putting the Value of row[1], is there another value I can input to point out that I want the last row to be cloned?

  • 12-08-2009 03:19 PM In reply to

    Re: Anyway to default fields of subsequent repeating table rows to match values in the first repeating row?

    Hello Davidair,

    I am a newbie in SharePoint and I was just wondering if you could help me on the following question. 

    I have put together an InfoPath form to record the surveys for one of our business processes. I have a repeating table which has the following 5 columns.
    1. Question
    2. Yes
    3. No
    4. N/a
    5. Comment
    I have also added 5 more rows to the repeating table by going to
    Tools-->Default Values, to accomodate more questions. I was able to specify
    the default values for each "question" field (text) by typing in some text. I
    also wanted to specify a conditional default value (using a formula) for
    "Comment" field in each row. But it seems that we can't specify a different
    formula derived default value for different rows in the repeating table. If I
    set the default value of "Comment" field in first row using a formula, the
    same formula is being applied to the "Comment" field in the rest of the rows. I need to have the text populated in the "comments" field automatically based on the answer the user chooses. The problem is that the possible set of comments is not the same for each question. 

    I have been struggling with this problem for the past one week. I would
    greatly appreciate it you could help.

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