Filtering a repeating section - InfoPath Dev
in

InfoPath Dev

Filtering a repeating section

Last post 10-01-2013 06:02 AM by HelenW. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-17-2013 08:16 AM

    Filtering a repeating section

    Hi, 

    I have a nested repeating section - my schema looks like this:

    myFields 

    gpBrands

    gpBrandDetails (repeating)

    gpContainer

    gpRepeating (repeating)

    Milestone

    msMarket

    msBrand

    rowNum

     

    I want one of my form views to only show the first three milestones for each Market while the entire list appears on another page.  When I'm working with a single market, it is no problem, but when I merge my forms and have multiple markets under a single brand, I cannot figure out how to filter so it just shows the first three for each market.

    Right now, when I'm in a single market form, I tell it if rowNum > 3, hide the section.  Once I merge the forms, I may have up to 10 countries, each with three or more milestones.  I want to be able to show the first three milestones per country

    Somehow I think I should be able to use a count function or something, but I'm at a loss.

    Any ideas?

    Thanks,

    Helen

     

     

     

  • 09-18-2013 07:49 AM In reply to

    Re: Filtering a repeating section

     I'd think that this might work:

    count(preceding-sibling::my:gpRepeating) > 2

    As a condition for your formatting - I'd add an expression box inside the gpRepeating section and use the formula editor to get the syntax right for this: count(preceding-sibling::my:gpRepeating)

    Then for your condition, change the first box to "The expression" and put in the expression when you know you have it right.

    Hilary Stoupa

  • 10-01-2013 06:02 AM In reply to

    Re: Filtering a repeating section

     Hi Hilary -

     Thanks for your reply; I'm a little slow in responding since I got pulled into other stuff but have finally returned to this.  

    Unfortunately, this doesn't take into account that we need to restrict it by market... so if i have 4 dates for the US market and 6 for the UK market, I want to show the first three for each.  That's what's stumping me.  How do I restrict it so that it shows the first three for each market?  I have 10 different markets....I suppose I could make 10 rules, one for each market??  Of course, if I add a new market to the form, then I will need to remember to update this rule, which is less than ideal.

    If you have any ideas of a more elegant solution, I'd be so grateful.

    Thanks again!

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