Finding "All Occurrences of" ?? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Finding "All Occurrences of" ??

Last post 03-08-2012 12:59 PM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 03-02-2012 10:21 AM

    Finding "All Occurrences of" ??

    Hi InfoPathers:

    I have an InfoPath 2010 filler form that contains a section with a repeating table.  In the repeating table, I have a set of 3 option buttons.  When all occurrences of the option buttons have been marked (i.e. are not blank), I want to fire an action rule that sets a value.  Problem is, I have been unable to find "All Occurrences of" in the Condition Builder.  I did find this post from Mel Balsamo, but have been unable to figure out her instructions.

    Based on another post here in the forum, I was able convert an instance of "All Occurrences of" to an expression and came up with the following "manual" xPath for what I'm trying to do: 

    not(my:ProdCats/my:gpProdCats/my:optNonCSSPassFail[. = ""]) where

    • ProdCats is a section
    • gpProdCats is my repeating table
    • optNonCSSPassFai is my option button set where I want all the instances to be filled out before my action rule fires.

    Right now, I can have 3 rows in my repeating table, fill out one set of option buttons but leave the other two sets blank, and it fires my action rule.  For whatever it's worth, I currently have my action rule attached to my set of option buttons.

    What am I missing?

    Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-02-2012 11:09 AM In reply to

    Re: Finding "All Occurrences of" ??

    OK, I've got it partly figured out.  For those of you, who like me, don't find it intuitive to find "All Occurrences of", here the closest I can get to a step-by-step breakdown:

    1.  Create your rule on a section, not a repeating table or an individual control.  Make sure you section shows the expander squares without the thick lines connecting them when you add your rule.

    2. Click the link for Condition to bring up your Condition Builder.

    3. In the Select dropdown, pick Select a Field or Group, then highlight the control you are interested in BUT DO NOT CLICK THE OK BUTTON.

    4. Click the Select dropdown again - this time you should see options for Any Occurrence of your control, All Occurrences of your control, Sum of all Occurrences of your control, and Number of Occurrences of your control.  Select All Occurrences of your control.

    5.  OK out.

    Problem is still the same as described above, though.  My action rule is triggering when I still have blank option buttons left.  Interestingly when I pick "All Occurrences of" this way and convert to an expression, it shows exactly the same xPath as what I entered manually above.

     Any ideas?

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-02-2012 01:57 PM In reply to

    Re: Finding "All Occurrences of" ??

    The section where I put my optNonCSSPassFail is one that I show by default but hide under certain circumstances.  I got to thinking that maybe the default row was triggering my Action Rule somehow, so I added criteria to my condition to reflect those that I want my section to be visible for.  Because my option buttons are blank by default, I shouldn't have to do this, but ya never know.  Can't hurt to block potential early firing.

    What's happening now is that if my repeating table ends up with 3 rows and I populate optNonCSSPassFail for the first row, it triggers my Action Rule.  If I start over from scratch and populate optNonCSSPassFail for the 2nd or 3rd row, my Action Rule does not trigger.  "All Occurrences are not blank" - yeah right.

    This is probably not helped by the fact that my table initially appears back on View 1 of my form, but in that location, the repeating table there does not include the option buttons I refer to here.  I want to grab the data that the user enters in that table and make it available in the second section where my option button appears, so I've bound that repeating table (where the option button appears), back to the table from the first section.  My repeating tables are basically 2 different views against the same underlying table.

    If anyone out there has dealt with anything similar, I'd sure like to hear about it.

    Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-02-2012 04:54 PM In reply to

    Ok, I just created a scaled down version of my form and am attaching it here.  Basically, I'm trying to auto-set the option button on the 2nd View based on whether any option buttons in the repeating table in the 2nd section on the 1st view are blank or not.  The default value of the option button is Credit Card - I'm trying to get my code to set it to Check if any of the option buttons in the repeating table are blank and Money Order if they are all filled out.  I have the Money Order part working, but not the Check part.  And based on this post, I've change from putting my rule on a section to putting two rules on my option buttons in the repeating table, which is where I really do want them. 

    Thanks,

    nkstrou

     

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-02-2012 05:18 PM In reply to

    Re: Finding "All Occurrences of" ??

    So, if any instance of Toy Type is blank.... set the field to Check?

    But the default of Toy Type is blank. So there is nothing to fire the rule.

    That is, Toy Type has to change to have the rules fire. Just inserting a new section won't do it.

    Does that make sense?

     

    Hilary Stoupa

  • 03-02-2012 05:25 PM In reply to

    So, the sample I re-attached here, right click the link, save it locally, right click the form, and select design to open in design mode, so you can preview.

    I left your money order rules in place and set the form not to inlcude the repeating group by default. Then when the user inserts the repeating section, the rule on it fires, checking to see if any instance of toy type is blank. The new one is, since blank is the default. I put the field that is being set on the same view, since switching views while debugging makes me crazy. :-)

    Hilary Stoupa

  • 03-08-2012 12:48 PM In reply to

    Re: Finding "All Occurrences of" ??

    Hilary:

    What do you do to tell the form not to include the repeating group by default?  I know there's an option when you set up a repeating table where you specify whether it has a header or not and how many rows...yeesh, I forget how that option is worded, but I always set it to 1 and the table always shows 1 row of data by default.  I'm assuming that's the thing you mean, because I see in the form you fixed for me that 0 data rows show by default and adding the item to the table is triggering the change I wanted.

     I've been all through the table properties, repeating table properties, section properties, and field properties and I've studied the data structure as closely as I know how, but I can't for the life of me figure out where you told it to do that.  Probably once I figure out where, I can figure out how.

    Can you help me out (again)?

     Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-08-2012 12:59 PM In reply to

    Re: Finding "All Occurrences of" ??

    It is hidden. :-)

    Under Tools > Default Values for IP 2007, and under the data tab on the ribbon, Default Values for IP 2010.

    From there you can click the "+" buttons to expand the schema nodes, find your repeating group, and deselect the checkbox next to it. You can also add instances here - if you ever need a form that defaults to 5 rows in a table or what have you.

    Hilary Stoupa

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