Conditions in rules limited to 5? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Conditions in rules limited to 5?

Last post 06-24-2019 11:32 AM by Hilary Stoupa. 24 replies.
Page 2 of 2 (25 items) < Previous 1 2
Sort Posts: Previous Next
  • 09-02-2014 01:01 PM In reply to

    Re: Conditions in rules limited to 5?

    BP, I gave this some thought. And, what I would do is to have a hidden field to be populated by either Show or Hide dependent upon a rule. Then I would put a format rule on the section to be shown that hides it unless the field contains Show.

    Then I would put something like the following logic on the hidden field:

    concat(substring("Show", 1, (Field1 = string(true())) and (Field2 = string(true())) and (Field3 = string(true())) * string-length("Show")), substring("Hide", 1, (Field1 = string(false())) or (Field2 = string(false())) or (Field3 = string(false())) * string-length("Hide")))
    Jeffrey J Vojtko
  • 05-24-2016 02:37 PM In reply to

    Re: Conditions in rules limited to 5?

      Thank you, Hilary-- great to know. The problem I'm running into now, though, is even if I have multiple AND conditions, the rule seems to treat them as if they're OR conditions. I have several (on my test I used 5) conditions using AND. The minute I make one of them TRUE, the field I'm hiding appears. How can I get the rule to not show the hidden field until all 5 conditions are met?

     

    Infopath Rules

     


     

     

  • 05-26-2016 01:41 PM In reply to

    Re: Conditions in rules limited to 5?

     Just wanted to link to the thread where we discussed this: http://www.infopathdev.com/forums/t/31309.aspx

    Hilary Stoupa

  • 11-15-2016 10:47 AM In reply to

    Re: Conditions in rules limited to 5?

    Sorry, I am not as experienced as experienced as some. If this is a validation rule, why are you using "is not blank"? Shouldn't it be "is blank"? And is the validation rule placed on the submit button? or each check box?
  • 11-16-2016 04:37 PM In reply to

    Re: Conditions in rules limited to 5?

    With custom validation rules, sometimes you don't want them to fire if the field is just blank - instead you are looking for it to contain specific values. Validation goes on specific fields - although if you prefer, you can add rules on submit to simply block submittal if specific fields are blank or don't have the correct values.
    Hilary Stoupa

  • 01-11-2018 11:39 AM In reply to

    Re: Conditions in rules limited to 5?

     

     This tip has helped me a lot. I was trying to display different various texts (ordinances) whenever different violations (NOV) are observed by inspectors. These violations are represented by boxes. I wanted to display the ordinances only when the boxes are checked. The issues I had was not able to write more than 5 conditions in a rule. Thanks to the above tips, I go it to work now.  

    If it helps, here is the expression I used:

    /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV1 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV2 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV3 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV4 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV9 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV10 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV11 != "True" and /dfs:myFields/dfs:dataFields/d:NOI_STORAGE/d:NEC_INSPECTION/@NOV12 != "True"

  • 08-10-2018 09:52 PM In reply to

    Re: Conditions in rules limited to 5?

    Hi Hilary, I have a requirement like user should not select already selected one in the form for "Location" field. I have 15 Location fields. So 15 Location fields should be unique. I have followed your suggestion and i am able to apply validation rules more than 5 but after form published to SharePoint those all 15 fields will become as "Mandatory" fields. But i need to show them as "Optional" fields. Is there any possibility that i can apply validation rule and the fields should be shown as optional. or else is there any alternative to achieve above scenario. Regards, Mounika
  • 09-28-2018 10:04 AM In reply to

    Re: Conditions in rules limited to 5?

    I had a similar issue and avoided using Hilary's "The Expression" option because I had so many conditions to check before allowing a user to submit the form for certain scenarios, that it would have been very tough to debug and troubleshoot. I also considered a straight sum-based solution because it also made troubleshooting difficult as you can't really tell which condition is missing, and you can't perform logical checks on what's been selected or filled-in. My solution was to set up a text CheckStatus field and a numeric CheckStatus-Value field. Rules on tested fields would add values to the CheckStatus field when the needed conditions were met. And when the CheckStatus-Value field hit the “magic number” (6 in the example below), then I would allow the user to submit the form. As an example, the CheckStatus-Value and CheckStatus fields are shown below, but would be hidden when the form is ready for production use: Then for every desired field, I assign a unique letter from “A” to “Z”, or from “a” to “z”, or from “0” to “9”, and test for the desired condition. In this way you could test for up to 62 concurrent conditions, tho that would be a bit crazy 😊 Every time the CheckStatus field changes, a rule runs to count the number of values and update CheckStatus-Value. IF the condition is True AND the CheckStatus field does not already contain the unique letter/number assigned to that field, then I add the assigned number/letter (using the concat function) to the CheckStatus field. If a blank value is a valid value under specific conditions then I add the letter/number for the field when that condition is met, so a ready-to-submit form always has the same value in the CheckStatus-Value field. (If a valid value is changed to a different valid value, ensure the letter/number is only added ONCE to the CheckStatus field.)   IF the condition is False, then I remove the assigned number/letter (using the translate function) from the CheckStatus field. IF the field being tested (Field-A) is dependent on another field (Field-B), I also add the Field-A rule to Field-B, so the user does not have to touch Field-A to update the CheckStatus. Be careful when copy-pasting the rules; remember InfoPath will change field names automatically! I also added the “’Add-x”’ rules to the Form Load rules (on the Data tab) to update CheckStatus every time the record is loaded. Hope this helps! -Steve
  • 06-24-2019 11:24 AM In reply to

    Re: Conditions in rules limited to 5?

    Bringing this thread back from the dead yet again! :)

    Can you use constants in a rule-based expression? I've tried this: (round(../my:TimesChangedResponsibility / "2")) - (. = ../my:TimesChangedResponsibility / "2") = "0" and several variations of it in the attempt of creating a "true" or "false" test for an even number, but it always rejects the "2" in the formula.
  • 06-24-2019 11:32 AM In reply to

    Re: Conditions in rules limited to 5?

    You'll probably need to use "div" instead of "/".

    If you use a function in the function builder like this:

    field1 / 2

    and then select Edit XPath so you can see the XPath, you'll see something like:

     ../../my:field1 div 2

    Hilary Stoupa

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