Binding non-repeating data to a repeating table - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Binding non-repeating data to a repeating table

Last post 01-12-2010 12:59 PM by andyd273. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-08-2007 01:16 PM

    Binding non-repeating data to a repeating table

    I have a repeating table of items to order that is bound to a database.

    Then I have a section named shipping information (ship to name, address, etc).

    When an order is placed for multiple items (e.g., multiple rows inserted), the shipping info binds to the first row only. In other words, in the database, if they order pens and staples, the shipping info is with the pen order but the staples record has nulls for the shipping information.

    Is there a way to bind non-repeating data to a repeating table?
    Thank you for your Help.

    Art
  • 03-19-2007 05:07 PM In reply to

    Re: Binding non-repeating data to a repeating table

    Hi Art,

    There are a couple of ways to do this:

    1. Write code in your Submit button that does the copying.
    2. Put a rule on each of the Shipping nodes that "If count(following-sibling::my:ShipppingNode) > 0 and count(preceding-sibling::my:ShipppingNode) = 0" THEN "Set a field's value (..//my:ShippingNode[position() > 1]/my:Address) = ."

    The condition for the rule makes sure that it only fires on the first instance of the repeating table so you don't get infinite recursion, and then the action sets each instance after the first one to the first one's value.

    I hope this makes sense, let me know if you have any problems!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-12-2010 11:12 AM In reply to

    Re: Binding non-repeating data to a repeating table

    I know this is a really old post, but this is something that I'm trying to figure out right now, and so I hope it's ok to resurrect it.

     

    I have two data sources, both SQL Server.

    Main puts the submitted form into a database table for me to do reporting type stuff, and is bound to a repeating table.

    Secondary is a list of customers that I use to fill a drop down box.

     

    I want to be able to select a customer in the drop down box, and have it put the CustomerID into the CustomerID box on each row of a repeating table so that it doesn't try to insert null values into the main data table.

    Currently, it works for the first row because row stores duplicate data, but not for any new rows. I used to know how to do this for stand alone controls, but not for repeating controls, and not for controls bound to a database. It's been quite a while since I've done much programming in infopath.

  • 01-12-2010 12:59 PM In reply to

    Re: Binding non-repeating data to a repeating table

    Never mind, I figured it out.

    I went into the data source, found the CustomerID and copied the xpath.

    Then in the default value I checked the edit xpath box, pasted in the xpath:

    /dfs:myFields/dfs:dataFields/d:frmScheduleRec/@CustomerID

    and told it to get the first occurrence:

    /dfs:myFields/dfs:dataFields/d:frmScheduleRec[1]/@CustomerID

     

    Now all new rows get the CustomerID like they should.

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