Return position() of node - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Return position() of node

Last post 05-19-2017 03:26 PM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-19-2017 12:05 PM

    • kee81
    • Not Ranked
    • Joined on 10-25-2016
    • Posts 9

    Return position() of node

    I have a situation where I'd like to get the position of a given record. Attached is my field setup. I have the queryFields/finished_cover_assembly/part_number query field on my form, but instead of running a query when a value is put into that text box and a button is pushed I instead want to run a rule that sets the CurrentRecordNumber field to the position of the dataFields/finished_cover_assembly node in the dataFields that has a matching part_number. Did that make sense? Is that possible to do in a formula?
  • 05-19-2017 12:18 PM In reply to

    • kee81
    • Not Ranked
    • Joined on 10-25-2016
    • Posts 9

    Re: Return position() of node

    I guess a little more detail here. I'm showing one "finished_cover_assembly" record at a time, and I have a navigation bar that lets me go to the next record, previous record, etc. So instead of doing a query which turns the dataset into just 1 record and makes my nav bar useless, I want to keep the whole dataset and just move between positions. Being able to type a part number and jump-to/show that record would be really slick. :)
  • 05-19-2017 12:31 PM In reply to

    Add a rule on your button that sets CurrentRecordNumber to the count of preceding siblings for the row that matches on part number. Simple sample attached, save the file locally, right click and select design then preview.
    Hilary Stoupa

  • 05-19-2017 01:47 PM In reply to

    • kee81
    • Not Ranked
    • Joined on 10-25-2016
    • Posts 9

    Re: Return position() of node

    Had to mess with the Xpath a little to figure it out, but that works PERFECTLY! Thanks, Hilary!
  • 05-19-2017 03:26 PM In reply to

    Re: Return position() of node

    Wonderful, glad you have it working. :)
    Hilary Stoupa

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