Rules on a field in a repeating section - InfoPath Dev
in

InfoPath Dev

Rules on a field in a repeating section

Last post 02-23-2013 08:05 PM by moldar. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-20-2013 05:47 PM

    • AlexK
    • Top 200 Contributor
    • Joined on 12-31-2012
    • Posts 61

    Rules on a field in a repeating section

    Consider this scenario: You have a repeating section with a dropdown field "Field A". Another separate non-repeating section has a field "Field B" that only shows when "Field A"'s dropdown is set to "A". Now the problem: when adding multiple repeating items of "Field A", "Field B" will only show if ALL of the repeated "Field A"s are set to "A"! How to get around this to show "Field B" when ANY of the dropdowns in "Field A" are set to "A"?

  • 02-23-2013 08:05 PM In reply to

    • moldar
    • Not Ranked
    • Joined on 02-23-2013
    • Posts 4

    Re: Rules on a field in a repeating section

    You can loop through the values of all the "Fields A"s in code. Create a flag field in your schema named "FieldBShow". If any of the "Field A"s are set to "A", then set that flag to true. If none of them are, set it to false. Then create a formatting rule that hides "Field B" based on whether or not "FieldBShow" is true/false. 

    You can do this by creating the code in the changed event for the repeating section of your schema.

     

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