Set field value based on other fields - InfoPath Dev
in

InfoPath Dev

Set field value based on other fields

Last post 09-11-2019 11:37 AM by Hilary Stoupa. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 09-11-2019 08:23 AM

    Set field value based on other fields

     Hi!

    I've got a bit of a issue trying to implement a couple of rules, any help is greatly appreciated! I'm working in InfoPath2010

    I have a validation field that I want to return "Yes" or "No" based on 9 other fields. I already know how to manipulate the rule setting to allow more than 5 conditions so that's not an issue. I want the following Rules in place:

    1) If any of the 9 fields are equal to "Yes" then my validation field will be "Yes"

    2) If all of the 9 fields are equal to "No" then my validation field will be "No"

    One of the issues I'm encountering is the situation where 1 of 9 are answered "Yes" but then changed to "No", my validation field stays at "Yes" even if all other 8 are "No".

    Would the rules we add go to the validation field or to each of the 9? I'm completely stumped 

    thanks in advance 

  • 09-11-2019 08:39 AM In reply to

    Re: Set field value based on other fields

    Do you have all the rules on all of the 9 fields? I'm wondering about using a default value for this. See attached sample - save the file locally, right click and select design and then you can preview. I'm using true / false instead of yes / no, but that's just because I'm too lazy to change all my checkboxes. Also, my "validation" field is just a calculated value, but the general logic should be about the same for a default value in a field....Feel free to attach a copy of your form under the Options tab in a reply if you need help implementing in your form.
    Hilary Stoupa

  • 09-11-2019 08:55 AM In reply to

    Re: Set field value based on other fields

     So I've tried creating rules in all 9 questions and I don't know if I even have them correct so I've disabled them in case I was on the right track. I've deleted all extraneous rows so you see the 9 dropdowns and with validation field in red, see attached. Thanks a million for helping. There's a validation Rule in place in all 9 questions which I need for something else. I was thinking I need to add "Action" rules

  • 09-11-2019 11:03 AM In reply to

    Re: Set field value based on other fields

     Looks like I got it to work just like your example - do you know how I can change the calculated field value from true and false to Yes and No?

  • 09-11-2019 11:16 AM In reply to

    Re: Set field value based on other fields

    I'd use two fields for this. A helper field with the calculation (that returns true / false) and then a rule on the helper field that sets your validation field to Yes if the helper field is true and sets the validation field to No if the helper field is false. The helper field doesn't have to show on your form. Or - if you don't need the actual data to be "Yes" / "No" you could have two calculated values on the form - one that says "Yes" and one that says "No" and show/hide them based on the result.
    Hilary Stoupa

  • 09-11-2019 11:30 AM In reply to

    Re: Set field value based on other fields

     so everything works perfectly except one last thing - and I noticed this on your form too. The validation field is set to "false" even when nothing is selected. is there a way to only trigger "false" when at least one tick box is selected?

  • 09-11-2019 11:37 AM In reply to

    Re: Set field value based on other fields

    The defaults on my fields are false - so you could set the default value to blank (if your fields are also true / false) and then you could change the calculated value field to either check that each field is not equal to false OR that it is true and not blank....
    Hilary Stoupa

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