Logical And/Or of a repeating table field - InfoPath Dev
in

InfoPath Dev

Logical And/Or of a repeating table field

Last post 11-21-2008 07:39 AM by Frederik Van Lierde. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-18-2008 07:29 PM

    Logical And/Or of a repeating table field

    Hello,

    Is there a way to set the value of a field to True or False, based on the Logical AND of the values of a field inside a repeating table?

    Basically I have a repeating table with a Pass/Fail field as one of the columns.

    I have another field (read only) in another section of the form, that should display "Fail" if any of the rows in my table have "Fail" in their "Fail/Pass" column.

    thank you in advance for your time and help.

    Regards,

  • 08-18-2008 08:21 PM In reply to

    Re: Logical And/Or of a repeating table field

    I have kind of found a very ugly way to do this, so I am still looking for a cleaner way.

    These are the steps I have taken to get me through what I need for now.

    First I assigned the following values to my repeating table column (which is a drop-down list box, “myPassFailField”):    
          Fail: value = 0 (default),     

          Pass: value = 1

    Then, I set the default value of my read only textbox (in a separate section of my form) using the following formula:    
          count(myPassFailField) - sum(myPassFailField)  

    I am able to display the number of records in my repeating table that are still in the failed status. 

    Each record will increment the count by one, since every record is counted. But only the “pass” values will add up in the “Sum”, therefore I will be left with the total count of Failed records.

    The only issue is that since my default value is “Fail”, even new forms will have a Fail count of 1.

    Hope this helps anybody with a similar problem, However I am still looking for the correct solution.

     

     

  • 11-21-2008 07:39 AM In reply to

    Re: Logical And/Or of a repeating table field

    An Aleternative is the following

    In your repeating table you can even use a Text box or another control
    Add a rule to this control in the repeating table

    - Add Rule
    - Set Condition
    - Select The Expression in the first Dropdown
    - Add count(/my:myFields/my:group2/my:group3/my:Status[. = string("Fail")]) = 0

             The bold chars, change it to the xpath of your control
             string("Fail")] : chnge the "Fail" to whatever value you want to check,  when you work with False/True, change it to string(false())

    Add as Action: Set Field, select your Global Field and set Success as value

    When all fields are different the Fail, the expression will return = 0, and the field will be updated with the name you like

    This expression you can also use as condition before submitting the form.

     

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.