Business Logic - IF - InfoPath Dev
in

InfoPath Dev

Business Logic - IF

Last post 02-02-2007 03:35 AM by nukkumatti. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-30-2007 07:31 AM

    Business Logic - IF

    How can I have a function like "if" in infopath?
    for example,
    I have three fields: A,B and C.
    If A is OK and B is OK, then automatically given OK to C field.

    I know I can use action to give field C a value when A field changes, but I won't be able to know the value in B field.

    I simplify the problem; actually I have to confirm five fields in order to give a value to a specific field.

    Please advice. Thanks.

    Troy
  • 01-30-2007 10:58 AM In reply to

    In the Rules dialog there is a Condition button. Check that and add the conditions. Five fields are fine.
    Patrick Halstead
    Project Manager at Qdabra
  • 01-31-2007 06:46 AM In reply to

    That's what I am using, but I doubt if there is a smart way to do so.
    Let's say I have three fields to confirm. Each field has to have about 10 rules because it would be (A,B,C)=(Yes,Yes,No) or (Yes,No,Yes) or (No,No,Yes) and so on.
    If one of the conditions is true, then the field D will automatically be set as True.
    However, I think this is a dump way. Won't it slow down the performance of the form?
  • 01-31-2007 10:12 AM In reply to

    Hi Troy0118,
    Yes, it's definitely a maintenance nightmare in InfoPath 2003. In 2007, you can use the new handy-dandy Logic Inspector. But anyway, you might be able to reduce the conditions by having extra fields with a layer of indirection between the fields you are checking and the actual values - in other words, set up an index for all states. That may require code though. Sounds like you need to write some code. Good luck!
    Patrick Halstead
    Project Manager at Qdabra
  • 01-31-2007 10:12 AM In reply to

    One more idea is to use SharePoint lists that have the values you should check and the result. That would make it easier to update the rule.
    Patrick Halstead
    Project Manager at Qdabra
  • 01-31-2007 10:20 AM In reply to

    Thanks a lot. I will try it out.
  • 02-01-2007 07:13 AM In reply to

    Another easier way to perform this logic is to use mutliplication. If you set your checkboxes to set as 0/1 instead of Yes/No then you can use A * B * C to determine if all are set to true. If all are 1 then output will be 1 (true), if any are 0, the output will be 0 (false).

    Hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-02-2007 03:35 AM In reply to

    One other thing to mention. The conditions are not limited to five conditions. When you use "The Expression" in the first drop down list you can actually have up to 30 statements within this expression line using xPath1Value = 1 OR xPath2Value = 2 AND xPath3Value = 0 and so on, just using AND/OR in between of the statements
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.