Get the number of items in repeating section - InfoPath Dev
in

InfoPath Dev

Get the number of items in repeating section

Last post 10-23-2007 02:59 AM by adamrharding. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-22-2007 09:05 AM

    • amsyo
    • Not Ranked
    • Joined on 10-22-2007
    • Posts 8

    Get the number of items in repeating section

    Hi,

    I have a repeating section and I want to know all the time the number of items inside the section. So I added a rule on the section to set a field's value to "count(repeating section)". This works only when the user inserts items, but not when the user deletes items from the repeating section. For some reason the rules aren't fired on the delete event.

     I am looking for a way to count the items in the repeating section (automatically, not by clicking a buton).

     Thank you,

    Andrei Gavrila

  • 10-22-2007 11:14 AM In reply to

    Re: Get the number of items in repeating section

    Hi

    Welcome to the forum

    Rules only fire once their condition is satisfied, and not any more, which is useful in some circumstances but not for your particular use.  You are better setting the default value of your count field to Count() and leave the "Update this value when the result of the formula is recalculated" ticked, that way it will add and subract to your hearts content.

    Double-click the count field and click the fx button and add the function count() and insert one of the fields you wish to count, job done.

    Best of luck with this wonderful tool

    Cheers

    Adam Harding
    Wales
    UK
  • 10-22-2007 11:54 AM In reply to

    • amsyo
    • Not Ranked
    • Joined on 10-22-2007
    • Posts 8

    Re: Get the number of items in repeating section

    Hi Adam,

    Yes, you are right ! It works.

    Thank You.

    I don't know why but I though that default values only get "initialized" at formload() and that's it. So I learned 2 things in one shot :)

    Have a good day !

  • 10-23-2007 02:59 AM In reply to

    Re: Get the number of items in repeating section

    Great news

    Glad that I could help

    Cheers

    Adam Harding
    Wales
    UK
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.