Nested Repeating Groups and the current() function - InfoPath Dev
in

InfoPath Dev

Nested Repeating Groups and the current() function

Last post 05-07-2010 12:13 PM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-23-2010 04:20 PM

    • Nick22
    • Not Ranked
    • Joined on 04-23-2010
    • Posts 3

    Nested Repeating Groups and the current() function

    I am trying to figure out how to get the current item of a repeating group that is nested within another repeating group.  Can anyone help with the xpath for this?

    My structure in my InfoPath form looks something like this:

    • Assembly_Item (repeating group)
      • my:Part_Families (group)
        • ns1:Purchased_Part (repeating group)
          • my:Component_Name (user selected from drop down menu)
          • my:Price_per_Unit (calculated in background)
        • ns1:Raw_Material (repeating group)
          • my:Material_Name (user selected from drop down menu)
          • my:Price_per_kg (calculated in background)

    I also have a secondary data souce, which is a SharePoint list, with the data that I need to filter.  There is one list with a column for "Component_Name" and a corresponding "Price_per_Unit", as well as a list with columns "Material_Name" and "Price_per_kg".

     

    The question, using this example, is how to get the current field for the "Component_Name" and "Material_Name" fields to use for filtering the corresponding secondary data sources to get "Price_per_Unit" and "Price_per_kg", respectively.

     

    Thanks!

    Nick22

    Filed under: , ,
  • 04-28-2010 03:35 PM In reply to

    Re: Nested Repeating Groups and the current() function

    Are you using IP 2003 or 2007? Do you want the Price_per_kg to be a calculated default? Or is its value set by a rule on the Material_Name?

    Hilary Stoupa

  • 04-28-2010 05:17 PM In reply to

    • Nick22
    • Not Ranked
    • Joined on 04-23-2010
    • Posts 3

    Re: Nested Repeating Groups and the current() function

    IP 2003.

     

    Price_per_kg is something I assume has to be a calculated default because it is in a repeating group.  If I use a rule on Material_Name, it sets all instances of Price_per_kg to one value.  The functionality that I need is to have (0 to unbounded) instances of "Raw_Material" with independant Material_Name values with their corresponding Price_per_kg values from the secondary datasource.  In other words, I need it to function like a VLOOKUP in Excel and for it to be updated automatically.

  • 05-04-2010 11:10 AM In reply to

    Re: Nested Repeating Groups and the current() function

    If I recall correctly, current() didn't work correctly in default values for IP 2003. You'll need to use a rule. It appears to me from your schema outline that Material name is in the same repeating group as Price per kg? Can you just attach a sample of your template? Under the Options tab, there is a place to attach a file...

    Hilary Stoupa

  • 05-05-2010 12:27 PM In reply to

    • Nick22
    • Not Ranked
    • Joined on 04-23-2010
    • Posts 3

    Re: Nested Repeating Groups and the current() function

    I was afraid of that with the current() funtion not working well in IP2003.

    I am a bit skeptical that rules would work in this situation as the repeating sections have fields that are based on other data fields of that instance, and a rule would set all values in a repeating section to the same value, which would not work.  EX: Sub-total of Material price is dependant on Material (drop down) and length (entered value), which can be different for each instance.  If it is any help, while in theory there could be between 1 - unbounded instances, there are mostly only between 1 and 5 in practice. 

    I am curious to hear your thoughts you see a work around for IP2003.

    Many thanks again for your help!

    -Nick

  • 05-07-2010 12:13 PM In reply to

    Re: Nested Repeating Groups and the current() function

    Just wanted to catch the thread up with the resolution -- in IP 2003, we need to use rules with the current() function -- it doesn't seem to work in default values.

    Hilary Stoupa

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