If/Else Conditional in Function - InfoPath Dev
in

InfoPath Dev

If/Else Conditional in Function

Last post 06-02-2006 12:42 PM by andreas.vogel. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-01-2006 04:46 PM

    If/Else Conditional in Function

    Hello,

    is it possible to have an if/else statement in the functions for a field? In Xpath? How would I go about doing this?

    I'm working on a costing sheet and a number of fields use different equations based on the value of a drop down.

    Thanks,
    -Andreas
  • 06-01-2006 10:45 PM In reply to

    Re: If/Else Conditional in Function

    Hello Andreas Welcome to Forums,
    Yes you can have an if/else statement in Xpath by using an OR symbol “|”. You can do that by giving this “my: myFields\my:Field1 | my:myFields\my:Field2” in function you want.

    Hope this helps!
  • 06-02-2006 12:42 PM In reply to

    Re: If/Else Conditional in Function

    Hi Shailaja,

    thank you for your reply. I don't quite understand what you mean with the OR symbol.

    I'm looking for a default function which does something like this.

    if (<somedropdownField> = "Foo")
    <someCalculatedField> = a*b*c
    elseif (<somedropdownField> = "Bar")
    <someCalculatedField> = b*c
    else
    <someCalculatedField> = 0


    The default value of <someCaluclatedField> should be set based on the drop down value selected of <somedropdownField>. So that <someCalculatedField> automatically updates itself whenever any of the values in the eqution are changed.
    Is there a way to access/set a fields - default value to an equation via code?

    Any thoughts?
    Thanks,
    -Andreas
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.