Selecting a Single Node Out of a Node Set - InfoPath Dev
in

InfoPath Dev

Selecting a Single Node Out of a Node Set

Last post 05-18-2012 02:36 PM by perrybob72. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-16-2012 03:09 PM

    Selecting a Single Node Out of a Node Set

    Hello all,

     I have been working on a process using InfoPath 2007 and Access 2007 to streamline processes from creating custom contracts all the way through processing and billing. One of the products that can be selected for the contract is in a repeating section so we can add multiple instances, we will call it Product A. After a signed contract is received and it is being processed in an InfoPath form, I have a repeating section, call it Order Details, where each instance of Product A needs to have a new section inserted in the Order Details table.

     I know I can return the length of a node to get the amount of instances of Product A and I could set a local field value to 1 and increase it every time a new section is inserted so I then have my node counter set. Is there a way that I can pull out a value from a certain node in the node set without code? I've looked everywhere and cannot find anyone even mentioning this. Say I am entering the details for the second instance of Product A, when I go into the rules to set a value to a field, I want to be able to enter a function that pulls the pricing field out of the 2nd node..

     Can anyone help me out?

     Thanks for your help!

  • 05-16-2012 05:49 PM In reply to

    Re: Selecting a Single Node Out of a Node Set

    Hi:

    If you want the value of the second instance of a node, the XPath looks like:

    my:myFields/my:group1/my:repeatingGroup[2]/my:Product

    With, of course, the XPath adjusted for your actual XML. The important bit is [2] or [3], or you can use the number() function and another field value to indicate the index -

    my:myFields/my:group1/my:repeatingGroup[number(pathtocounterfield)]/my:Product

     

    Hilary Stoupa

  • 05-18-2012 02:36 PM In reply to

    Re: Selecting a Single Node Out of a Node Set

     Got it working, thanks so much for your help!

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