Getting repeating group data into a repeating section - InfoPath Dev
in

InfoPath Dev

Getting repeating group data into a repeating section

Last post 04-20-2012 10:33 AM by PaulRAnderson. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-19-2012 04:28 PM

    Getting repeating group data into a repeating section

    I have a repeating group called Group (really, there's a reason for that, it's not just a lame name) that contains a field called GroupName.  There is a repeating section that is most often used for one item, but users can add additional items.  Each of these items corresponds to one Group.

    I want the appropriate GroupName field to appear in the repeating section.  Group 1's name should appear in the first instance of the section, group 2's name should appear in the second instance, and so on.

    But I can't get this to work.  Referencing GroupName always gives me the name of the first group.

    The repeating section is defined within the Group group as I assumed that's from where the various GroupName fields could be accessed.  And I've tried GroupName[position()] as a value but that always gets me the first group too.

    Any suggestions or pointers to solutions would be much appreciated.

     

    Paul

  • 04-19-2012 06:17 PM In reply to

    Re: Getting repeating group data into a repeating section

    Hi - any chance you can attach a screen shot of your main data source? Under the Options tab, you can attach a file...

    If your repeating section is bound to Group, and GroupName is a field in Group - well, by default you should be getting the correct instance of GroupName in each Group.... So, I'm sort of perplexed.

    Hilary Stoupa

  • 04-20-2012 07:32 AM In reply to

    Re: Getting repeating group data into a repeating section

    Here is the relevant portion of the main data source:

          <Groups>
            <Group>
              <GroupName>
              </GroupName>
              <GroupIPAddress>
              </GroupIPAddress>
              <GroupGateway>
              </GroupGateway>
              <my:Graph1 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-03-16T10:53:27">
                <my:Graph1Title> Group Configuration Summary</my:Graph1Title>
                <my:Graph1Image xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true">
                </my:Graph1Image>
              </my:Graph1>
            </Group>
          </Groups>

    Groups is a non-repeating group; Group is a repeating group.  Graph1 is a repeating group.

    On the screen, the group Graph1 is in a repeating section.

    The field Graph1Title has a value to it:  concat(GroupName, " Group Configuration Summary")

    When the user adds a repeating section, the first GroupName is always used to form the title.

    Paul

  • 04-20-2012 07:45 AM In reply to

    Re: Getting repeating group data into a repeating section

    When I try to bind the section that contains the repeating section to Group or Groups, this is what I get.  Is this part of my problem?


  • 04-20-2012 08:31 AM In reply to

    Re: Getting repeating group data into a repeating section

    Check the "Edit XPath" check box in the formula editor - what's the XPath used for GroupName? I bet an abosolute XPath is being used there. It should be using a relative path ... did you select the GroupName field with the field picker?

    Hilary Stoupa

  • 04-20-2012 08:52 AM In reply to

    Re: Getting repeating group data into a repeating section

    Hilary Stoupa:

    Check the "Edit XPath" check box in the formula editor - what's the XPath used for GroupName? I bet an abosolute XPath is being used there. It should be using a relative path ... did you select the GroupName field with the field picker?

    The XPath for GroupName is:

    /SAN/EQLCollection/EQLArray/Groups/Group/GroupName

    What should the XPath be for GroupName?

    And yes, I selected the GroupName field with the field picker.

    Paul

  • 04-20-2012 09:07 AM In reply to

    Re: Getting repeating group data into a repeating section

    Group is not repeating - but you should be able to bind to Groups....

    Hilary Stoupa

  • 04-20-2012 09:09 AM In reply to

    Re: Getting repeating group data into a repeating section

    I'd think it would be

    ../../GroupName

    Because you are at Graph1Title, and you go up once to Graph1 and then once again to Group, then down to GroupName....

    Hilary Stoupa

  • 04-20-2012 10:33 AM In reply to

    Re: Getting repeating group data into a repeating section

    I thought I had chosen this path before, but this works:

    • Repeating section with title based on GroupName is bound to repeating group Graph1.
    • Section containing four of these repeating sections is bound to non-repeating group Groups.
    • GroupName XPath is exactly as it was--absolute reference

    So thank you for your help.  Through your help or my randomness it is now working.

    Paul

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