xpath to search Infopath repeating table for the next record with a certain value in a variable and return the corresponding record number - InfoPath Dev
in

InfoPath Dev

xpath to search Infopath repeating table for the next record with a certain value in a variable and return the corresponding record number

Last post 03-14-2015 02:56 AM by AndreasEG. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-08-2015 03:18 AM

    xpath to search Infopath repeating table for the next record with a certain value in a variable and return the corresponding record number

    Hi,

    I have a repeating table with 3 variables:

    "CurrentRecord": automatically filled with a sequential record number 1,2,3...

    "Track": boolean: filled by the user as yes/no

    "NextTrackedStep": number which should be calculated as the "CurrentRecord" of the next record where "Tracked" is true.

    The table looks like this:

    Current Record; Track; Next Tracked Step

    1;true;2

    2;true;5

    3;false;5

    4;false;5

    5;true;6

    6;true;

     I tried this formula for the default value of "NextTrackedStep" but it does not work:   ../following-sibling::my:group2[true() = (../following-sibling::my:group2/my:Track)]/my:CurrentRecord

    Event though this is a simple search problem I could not find an article that really fits. 

    Any idea?

    I attach the XSN and XML files.

     Regards

    Andreas 

     

  • 02-13-2015 12:07 PM In reply to

    Re: xpath to search Infopath repeating table for the next record with a certain value in a variable and return the corresponding record number

    I think this would be the right formula:

    ../following-sibling::my:group2[my:Track = "true"]/my:CurrentRecord

    Hilary Stoupa

  • 03-14-2015 02:56 AM In reply to

    Re: xpath to search Infopath repeating table for the next record with a certain value in a variable and return the corresponding record number

    Hi Hilary, thanks - great - it works perfectly.

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