Support » Plugin: Calculated Fields Form » Values in a range

  • Resolved mftzk

    (@mftzk)


    Hi, I’ve downloaded the plugin a long time ago but have never been able to figure it out: is it possible to show a determined result based on values in a range? Example:

    IF valueX>=valueY AND valueX<=ValueZ, result is “B”

    Thanks already!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mftzk

    My apologies for the delay in respond to your ticket.

    Yes, that’s possible and very simple. There are different alternatives:

    Using the “IF” and “AND” operations included by the plugin:

    
    IF(AND(10<fieldname1,fieldname1<100), 'Result A', 'Result B')
    

    Using the same operation but with the logical operator of javascript (&&)

    
    IF(10<fieldname1 && fieldname1<100, 'Result A', 'Result B')
    

    Using the ternary operator of javascript:

    
    (10<fieldname1 && fieldname1<100) ? 'Result A' : 'Result B'
    

    Using the “if” conditional statement (javascript is case sensitive, do not confuse the “if” conditional statement of javascript with the “IF” operation in the plugin), in this case it is required to define the equation as a function:

    
    (function(){
    if(10<fieldname1 && fieldname1<100) return 'Result A';
    return 'Result B';
    })()
    

    All previous equations are equivalent.

    Best regards.

    I’m gonna try it! Thank you very much, awesome support!

    Plugin Author codepeople

    (@codepeople)

    Hello @mftzk

    It has been a pleasure.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Values in a range’ is closed to new replies.