Trouble with setting rules on textbox - InfoPath Dev
in

InfoPath Dev

Trouble with setting rules on textbox

Last post 09-03-2010 06:37 PM by Sailor. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 09-02-2010 12:54 PM

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Trouble with setting rules on textbox

    Hello,

     I created a form which  has a number of drop-down list boxes with the choices "Yes", "No", "N/A".  I also have a text box "Failures" at the bottom of the form which i want to be filled based on conditions of all of the Yes/No fields.

     I setup the rule on the  "Failures" textbox as below. This was due to the 5 condition limit as I read from a separate thread.

    Condition

      The Expression ../my:field1 = "Yes" or ../my:field4 = "No" or ../my:field5 = "Yes" or ../my:field6 = "No" or ../my:field8 = "No" or ../my:field9 = "No" or ../my:field10 = "No" or ../my:field30 = "No" or ../my:field11 = "Yes" or ../my:field12 = "No"

     Action

     Set a fields value: . = "Fail"

     

    When I try the form the Failures textbox does not have the word "Fail" in it even when the conditions are set properly.  Should this be working?

     

  • 09-02-2010 02:17 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Trouble with setting rules on textbox

     Ok please be easy on me.  Now that I read more I think i see that you can't do what I'm trying to.  I want the "Failures" textbox only to be populated with "Fail" of any of my conditions are met (any of the other fields are set to yes or no).

    Do I understand that the only way to do this is by setting rules on each of the Yes/No filelds to set the "Failures" field based on those fields?

     

    God that's hard to explain.  I hope someone can understand what I want to do!

  • 09-02-2010 02:41 PM In reply to

    Re: Trouble with setting rules on textbox

    Actually -- this should be do-able. Can you attach your template to a reply (under the "Options" tab), so I can take a peek?

    Hilary Stoupa

  • 09-02-2010 02:50 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Trouble with setting rules on textbox

     Hello,

     Thank you for your help.  Yes this is a simple form but excuse my errors in design, etc.  I'm learning!

     

    The field I'm trying to set is called PassFail.

  • 09-02-2010 03:25 PM In reply to

    Re: Trouble with setting rules on textbox

    We all had to learn at one time or another...

    You have set your rule on the PassFail field. Rules only fire when a field changes -- so the PassFail field has to change in order for your rule to run.... and if it did change and your rule did run, you'd probably get an error about your rule creating an endless loop.

    I'd probably use an expression box, instead of a text field. And then I'd conditionally format it to hide unless certain conditions are true. I've added a sample of this to your form -- the expression boxes are only formatted to look at the first field, and I've most likely got the wrong answer showing "Fail", but you'll get the idea.

    Right click the link on the template in the heading of this message to save it locally. Then right click on the saved file and select Design to open in design mode so you can see what I changed.

    Before you start having users fill out this form, make sure you update the names of the fields in your data source -- you'll be annoyed with yourself if in a few months you have to make changes and your field names are "field1" and so forth.

     

    Hilary Stoupa

  • 09-03-2010 07:12 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Trouble with setting rules on textbox

     Hi Hillary,

     I see what you have done, and that DOES make sense to me.  Although I don't think it will ultimately solve my problem.  The big reason I want a Pass or Fail recorded is so that I can "filter" or group my results in Sharepoint based on that field.  You have been very helpful, and I'm wondering if you might know of another way i could accomplish this?

     And yes, I will change those field names!  

  • 09-03-2010 07:59 AM In reply to

    Re: Trouble with setting rules on textbox

    I'm wondering what the logic is with your questions -- for some "yes" would mean fail, for others "no" would mean fail, is that correct? If this were mine, I'd try to standardize it so that I could use a repeating section. I'd use a display of "Yes", "No", and "N/A", with, perhaps, any "No" answers setting my field to "Fail"... my values for those options would be numeric, I'd have a "Score" field that would then determine whether I'd passed or failed....

    I'll post a quick sample later today, so you can kind of get a sense of what I mean -- it will be afternoon or evening, tho.

    Hilary Stoupa

  • 09-03-2010 08:24 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Trouble with setting rules on textbox

     Yes I did try to word all the questions so that all of them would either use a yes (or a no) for a failure, but the wording wouldn't work.  For this form one failure out of all the questions would create a failure for the entire form.  In my mind it seemed easy, but maybe that's why I'm not a programmer or developer :-)

    I'm not sure I understand your suggestion but I welcome any sample or example. As you can tell I'm struggling!

  • 09-03-2010 01:14 PM In reply to

    Re: Trouble with setting rules on textbox

    Here's an attached sample where any "No" answer = Fail. You won't see all the questions in the repeating table until you preview. To see where the questions are, look in the default values for the form (this is under Tools / Default Values in IP 2007).

    You could change the button labels to "Pass" and "Fail" instead of "Yes" and "No", too, and use statements instead of questions.....

    Hilary Stoupa

  • 09-03-2010 06:37 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Trouble with setting rules on textbox

    Hello again,

     

    You have been most helpful.  I think I understand how repeating tables work now (I was most definitely understanding them right from my reading). I'm not sure if I will change this layout or not (I'm not 100% sure how the repeating table helps me), but I certainly understand from you example how to do what I need.  I have been able to accomplish this one small step!

     Thank you!

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