• Resolved Francis

    (@emolotel)


    Hello
    I have to use a value in a function including giving me a string.
    Example
    if (AND (first> 20 <50, second == 1)) return ‘COMPLIANT CHOICE’;

    The value must be greater than 20 and less than 50

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

    (@codepeople)

    Hello @emolotel

    The way to compare for a range in javascript is using two conditions connected by an AND:

    
    if (AND (20<first, first <50, second == 1)) return 'COMPLIANT CHOICE';
    

    Best regards.

    Thread Starter Francis

    (@emolotel)

    the value must be between 20 and 50 and must be COMPLIANT

    if the value is <20 or> 50 it must be non-compliant

    example:

    calculated range: > 20 and <50 = compliant

    calculated range: <20 and> 50 = non-compliant

    • This reply was modified 5 years, 11 months ago by Francis.
    • This reply was modified 5 years, 11 months ago by Francis.
    Plugin Author codepeople

    (@codepeople)

    Hello @emolotel

    Honestly, I never understand your tickets, I don’t know exactly what do you mean. If you want the equation returns COMPLIANT or NON-COMPLIANT texts based on the values of field, you should use the instruction: if…else…

    If you want to implement complex equations there is a learning curve you cannot avoid, you need some basic knowledge of javascript.

    
    if (AND (20<first, first <50, second == 1)) return 'COMPLIANT CHOICE';
    else return 'NON-COMPLIANT CHOICE';
    

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘value included’ is closed to new replies.