Repeating Table Shows Duplicate Default Values - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating Table Shows Duplicate Default Values

Last post 04-12-2016 01:48 PM by KenNC1. 25 replies.
Page 2 of 2 (26 items) < Previous 1 2
Sort Posts: Previous Next
  • 04-11-2016 10:52 AM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    I have 5000+ existing forms in a SharePoint form library and I think writing a PowerShell script or using QRules would be a last resort, although I'm up against a deadline and may need to consider those options.

    Final questions before I completely reverse course and (possibly) re-design my form --

    Is there a way to use a secondary data source to populate the repeating table using rules?  I was hoping that using a separate xml file would work in this case.

    Can upgrade.xsl be modified to copy all of the default rows, instead of only the first row? 

  • 04-11-2016 11:24 AM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    You might be able to do something with a separate XML file - can the user change the values in the fields where you are setting a default? InfoPath is going to control the contents of upgrade.xsl - that's why you'd use a custom event for upgrade & write code to handle for this.
    Hilary Stoupa

  • 04-11-2016 11:49 AM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    Maybe there is a better way to do what I'm doing.  Basically what I'm trying to do is create a table that has 7 columns, 5 of which contain static data, but the static data differs for each row in the table.  The user can update two columns in each row.  There will be a total of 70+ rows in the table.  The repeating table works great for the calculations that I need to do on the two columns that the user can update.  I need a way to pre-fill the repeating table with the static data for both new forms, and existing forms.  I thought that if it was the default data that was causing my issue, then perhaps pre-filling from a secondary data source would work.

  • 04-11-2016 11:59 AM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    I think it will. My concern was with the columns the user would be entering data in. I'm guessing those don't already exist in your existing XML files? I've attached a sample form that uses this approach.
    Hilary Stoupa

  • 04-11-2016 12:09 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    With my test form that I attached, I combined default data to add the rows, then formulas as default values. When I removed all instances of group2 from a sample XML file and re-opened it, the second row displayed data correctly but not the first - so this approach may still not work. Again, if you are going to copy data from a secondary data source into the main data source, you'll need code for adding repeating rows, unless you use default data.... you could also use rules & a helper field for this - see attached.
    Hilary Stoupa

  • 04-11-2016 12:12 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

     As if I'm not difficult enough, I'm using IP 2010 and can't open your attached template. 

  • 04-11-2016 12:37 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    Attached as 2010 here - I think this approach is going to do what you need - note the update field with rules on it that is set in a form load rule. :)
    Hilary Stoupa

  • 04-11-2016 02:28 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

     Hilary this looks fantastic and I'm pretty sure that it will work for me.  I can't thank you enough for your time.

    I'm embarrassed to ask this, but .. how did you enter this formula?  I'm trying to enter the formula and even when keyed exactly as in the template it won't work for me.  Are you inserting functions and fields into the formula, or did you just key it directly as is into the formula window? 

  • 04-11-2016 02:31 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    I meant to include the formula in my last post --


    Row[count(current()/../preceding-sibling::group2) + 1]/Field1 

  • 04-11-2016 02:33 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

    Preceding-sibling can be tricky to get the hang of. What I did was select the field in the secondary data source. Then I clicked Edit XPath, and manually added the filter with the square brackets. The filter returns a number - a count of the preceding siblings in the main data source, adding one, since we want to get the same index as our current row (i.e., row 1 will have a preceding-sibling count of 0). Your formula will likely look similar, but the XPath will change because the name of your repeating group will be different than mine.
    Hilary Stoupa

  • 04-12-2016 01:48 PM In reply to

    Re: Repeating Table Shows Duplicate Default Values

     I'm very close to incorporating your solution into my IP form.  What I'm seeing is that only the first row from the secondary xml data source is being used to populate the repeating nodes. What I've noticed is that InfoPath has inserted "descendant-or-self::node()/" into my formula.  Yet, when I try to remove that text, the formula raises an error, indicating that the path doesn't point to a valid location of a field or group.  Have you ever seen this before, and could this be the reason that only the first row of the secondary data source is populating all of the repeating nodes?

     

    xdXDocument:GetDOM("Data")/Data/Row[count(current()/../../../../../../descendant-or-self::node()/preceding-sibling::my:REPEATING_TABLE) + 1]/Format 

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