The name of the second repeating section - InfoPath Dev
in

InfoPath Dev

The name of the second repeating section

Last post 02-08-2010 06:17 AM by Jimmy. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 02-07-2010 11:00 PM

    The name of the second repeating section

    Hello,

    Simply question: If the name of the control in repeating section is "X", what is its name in the second repeating section? I mean, how I can refer to this control (and its value) in the second section?

  • 02-07-2010 11:35 PM In reply to

    Re: The name of the second repeating section

     If my:GroupA is the name of your repeating group and my:FieldB is the name of the field you want to target, then the path to FieldB in the second row of GroupA would be

    my:GroupA[2]/my:FieldB

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-08-2010 12:17 AM In reply to

    Re: The name of the second repeating section

    Hi Jimmy,

    Thanks for your answer but I didn't get it to work yet.

    My structure in the form is:

    RepeatingsectionA

                   SectionB

                                 SectionC

                                                FieldD

     

    Now, to test and display the value of FieldD in the second row of RepeatingsectionA, I created a text field and set default value Fx: RepeatingsectionA[2] / .. / FieldD but It returns only NaN (although I filled the second FieldD with numeric value). What I am doing wrong?

  • 02-08-2010 12:26 AM In reply to

    Re: The name of the second repeating section

     Try removing the spaces before and after the slashes.  What's the exact formula you see when you click the Show XPath checkbox in the formula builder?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-08-2010 12:36 AM In reply to

    Re: The name of the second repeating section

    Jimmy my saviour, thanks! The spaces and slashes we generated automatically by infopath but using XPath did the trick. Hopefully this allows me to advance and fix the initial problem with database data connection query.

  • 02-08-2010 01:59 AM In reply to

    Re: The name of the second repeating section

    Considering the same case as above: 

    I'm instantly in another problem; How come following XPath code doesn't work:

    ../my:SectionX/my:SectionY/my:RepeatingsectionA[count(../my:SectionX/my:SectionY/my:RepeatingsectionA)]/my:SectionB/my:SectionC/my:CCnumber

    I need to make this section row numbering variable

  • 02-08-2010 04:09 AM In reply to

    Re: The name of the second repeating section

    There is something that I simply can't understand:

    count(SectionA) => number returned, OK!

    my:SectionA[1]/my:FieldB => Field value returned, OK!

    my:SectionA[count(SectionA)]/my:FieldB => The formula contains one or more errors; how is that possible?!

  • 02-08-2010 06:17 AM In reply to

    Re: The name of the second repeating section

     my:SectionA[count(../my:SectionA)] should do the trick, but for this purpose, my:SectionA[last()] should work just as well.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.