Rule not populating new Value - InfoPath Dev
in

InfoPath Dev

Rule not populating new Value

Last post 02-02-2011 07:55 PM by amenne. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-31-2011 09:01 PM

    • amenne
    • Not Ranked
    • Joined on 01-31-2011
    • Posts 3

    Rule not populating new Value

     I am trying to write a dynamic Scope of work. I have included 6 Check boxes  (MFG1, MFG2, MFG3, etc).
    The I want to dynamically populate a string field based on which check boxes are selected.


    Example:

    "...delivery and installation of (field1) hereafter referred to as “system”.

    If MFG1 and MFG3 are selected, I want the above sentence to say:

     "...delivery and installation of widget and wadget hereafter referred to as “system”.

     I have built a rule on MFG1 check box that says if the value of MFG1 is NOT equal to false, then change the value of field1 to widget. I have created a button that runs a rule to update field 1 but have a few problems,

    1.) You can only have 5 check boxes to be checked in an individual rules list.
    2.) A customer may buy MFG1, 3, and 5 or Just 1 or all products, etc.. Any combination really. How do I build the logic to address whats has actually been selected?
           if my Newbie mind I would use some kind of nested If then statement with concat function. I just dont know how to do that in Infopath 2010.

    3.) If one item is selected I would like just the word "widget" to appear, if two are selected It should read: "widget and widget" and if three or more are selected, it should read" "widget, widget, and widget"
    Basically, proper grammar with commas and the word "and" in the proper location.

     

    Ideas?

    Thanks

    ADM

  • 02-01-2011 08:06 AM In reply to

    Re: Rule not populating new Value

    Hi:

    First, for item 1 -- this is a common misconception. There is a UI limitation on conditions -- true. IP will only let you add 5. But if you change the first dropdown in a condition to "the expression" you can write your own XPath, like this:

    my:field1 != '' and my:field2 != '' and my:field3 != ''

    And so forth, using "and", "or" and parenthesis as needed to get your expression correct.

    If you don't know what the XPath for a condition would be, leverage the UI -- set up the condition as usual with the dropdown boxes (selecting fields, operators, etc) and then change the first drop down to "the expression" -- your condition will be displayed as XPath in the text field after the first drop down.

    I, too, wish for some kind of "If - then" ability for rules or defaults....but we don't have it. So it will need to be conditions and rules.

    Sometimes, the easiest route is to create a number of expression boxes (calculated values in IP 2010, I think), each using the correct formula for the different options you may wish to display, and then conditionally format the expression box. I think in a more complex scenario like yours, it is six of one, half dozen of another -- either way you are going to have a lot of conditions, since there are a lot of possible combinations.

    There is a work around for creating a type of conditional default, but the formulas appear to be somewhat complex and you may or may not want to invest the time in understanding them when you can work around this with conditional formatting. Here's a blog post from the InfoPath Team that outlines this idea.

    Hilary Stoupa

  • 02-02-2011 07:55 PM In reply to

    • amenne
    • Not Ranked
    • Joined on 01-31-2011
    • Posts 3

    Re: Rule not populating new Value

     Thank you for the help!

     

    Regards,

    Adam

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