Rules for setting other values - InfoPath Dev
in

InfoPath Dev

Rules for setting other values

Last post 10-01-2010 10:43 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-21-2010 06:51 AM

    Rules for setting other values

    Ok, I have a multi-selection list box;

    Value 1
    Value 2
    Value 3
    Value 4

     I have 3 radio boxes;

    Radio1
    Radio2

    1 checkox;

    Chkbox1

     If value 1 is selected I want Radio1 and checkbox 1 selected

    If value 2 / 3 / 4 is selected. I want Radio2 selected, but with chkbox1 and radio deslected.

    if value 1 and a mixture of 2 / 3 / 4 is selected, I want Radio1 and chkbox1 selected.

     I've had a play with the conditions, and my results are hit and miss...

     Thanks.

     Pete

     

     

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

    Re: Rules for setting other values

    Can you attach your template to a reply (under the Options tab when you reply) or maybe some additional info about the conditions you've tried?

    My guess is that since your rules are based off a repeating field, you'll may need to use preceding or following-sibling in the conditions to take into account all instances of the field bound to the multi select....

    Hilary Stoupa

  • 09-22-2010 03:03 AM In reply to

    Re: Rules for setting other values

    Hi Hilary,

    Thanks for your reply. I have attached my form (please be aware I have stripped some things from the form for public consumption, The section you will be interested in is "Domain:" Values / 1 - 5

     It will be clear what is happening when you select different combinations etc...

    Thanks again.

     Pete

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

    Re: Rules for setting other values

    Right click the link to the attached file and save the file locally, then you can right click again to open in design mode and preview.

    I'm not entirely sure what your desired outcome is, but I modified the conditions on two of your rules for the field bound to your multi select so that basically one ruleset runs if Value1 is not ever selected and another runs if Value1 is selected. I think you'll be able to modify from here after taking a look.

    As an aside, if this form is not yet in production, I highly recommend you take the time to rename all the fields and groups in your data source. I remember one of my first forms where I didn't -- that thing was a nightmare to work with, of course, because you always have to figure out what field field51 is, over an over again. Also, be sure you delete any fields you aren't using. It will make things so much easier for you, and if this isn't in production yet, now is the time to take care of it.

    Let me know if you have trouble with the conditions or need more info!

    Hilary Stoupa

  • 09-27-2010 05:35 AM In reply to

    Re: Rules for setting other values

    Hi Hilary,

    Seems to behave a little more consistant now - Thankyou.

     I have taken your advise and renamed all my fields, and removed any ones I'm not using :)

    A couple more questions.... maybe its just me being picky...

     If I select value1 and then value 2, but then deselect value 1 the other fields are still set - how would I make it so that upon deselecting value1, it un-sets the fields clicking it sets, and also if all values are de-selected, it also unsets the values it's set.

     as a side question - How can I make a multi-selection list value select multiple values in another multi-selection list?

    Thanks.

    Pete

     

     

  • 09-29-2010 05:59 AM In reply to

    Re: Rules for setting other values

    bump :-)

  • 09-29-2010 11:41 AM In reply to

    Re: Rules for setting other values

    Hey, Pete:

    Sorry -- I'd seen this and flagged it, but just haven't had a chance to dig back into that sample to figure out the correct conditions. It seems that for a multi-select, if nothing is selected, there is a single, blank instance of the repeating field in the XML -- preview your form and save the preview and take a look at the XML to see. But I think that the same field is always present and blank -- which means it doesn't change, thus won't fire a rule. You may want to try using another field in a secondary data source that holds (for example) a count of the fields for the list that are blank, then add a rule to the field the list is bound to that will update THAT field -- and set your rule on it. I'm just not sure without actually trying a few things.

    I'll try to take a look at this in the next day or so, okay?

    Hilary Stoupa

  • 10-01-2010 10:43 AM In reply to

    Re: Rules for setting other values

    I think you'll need to add another field that has a default value like:

    count(../my:group1/my:List1[. != ""])

    You can set rules on it to run that unset the values that are set when fields are selected -- the condition would be that the field is equal to zero.

    Here's another thread with more info on multiselects and why they can be so tricky.

    As to your side question -- since with a multiselect InfoPath adds a node on the fly, I don't think there is a way to do that with rules alone, unless you are using qRules.

    Hilary Stoupa

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