Counting number of occurrences of a repeating group - InfoPath Dev
in

InfoPath Dev

Counting number of occurrences of a repeating group

Last post 04-30-2009 03:57 PM by jhelfrich. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-23-2008 07:55 PM

    Counting number of occurrences of a repeating group

    My InfoPath 2007 form has a repeating group whose fields hold data related to meeting attendees (attendee names, contact info, etc.)  One of the fields (labeled Meeting No.) exists to show the meeting's number in the sequence of more than one meeting.  I want this field's value to automatically increment by 1 each time a new meeting / group is invoked. 

    Currently, I have the Meeting No. default value set to 1.  I've set rules in both parent group and repeating group to "set a field's value" where I reference the meeting no. field and add "1" to it.  When I then increment the repeating group, it is taking the default value each time, and adding 1 to it... so.. the second group is labeled 2, but so is the third group.

    How can I get the "meeting no." field to increment correctly?

  • 08-24-2008 10:41 AM In reply to

    Re: Counting number of occurrences of a repeating group

    Hi:

    You can use preceding-sibling with the count function to create a row counter (or, in your case, a meeting number). Here is a sample form that uses that functionality. Since this count will be zero based, you need to add one to the formula for the counter to begin with 1 (because, for the first group, if you count the preceding-siblings, you will have zero, of course!).

    If the sample is too general and you need more help, let me know, and post a screenshot (or describe) your data source so I'll be able to figure out the correct xpath.

    Hilary Stoupa

  • 08-24-2008 03:09 PM In reply to

    Re: Counting number of occurrences of a repeating group

    Hilary..it worked like a champ.  Thanks!

  • 08-24-2008 03:30 PM In reply to

    Re: Counting number of occurrences of a repeating group

    Fantastic -- glad you were able to translate the xpath to your data source!

    Hilary Stoupa

  • 04-30-2009 02:49 PM In reply to

    Re: Counting number of occurrences of a repeating group

     Hello,

     I have the same issue, but the link is borken on your sample. Can you help me out?

  • 04-30-2009 03:50 PM In reply to

    Re: Counting number of occurrences of a repeating group

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 04-30-2009 03:57 PM In reply to

    Re: Counting number of occurrences of a repeating group

    Thanks so much...I got it.

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