• Resolved momo2105

    (@momo2105)


    I have form who i use Dropdown menu and i need in calculate field use more conditions for displaying the result.

    i have use with function but dont work:

    (function(){
    IF(fieldname1 == ‘ECB’ && fieldname2 == ‘RD’ && fieldname4 == ‘dotacia’)315,165;
    IF(fieldname1 == ‘EHB’ && fieldname2 == ‘RD’ && fieldname4 == ‘dotacia’)750,300;
    })();

    please help me

    • This topic was modified 11 months, 3 weeks ago by momo2105.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @momo2105,

    Your equation has some parsing errors, so I’m not sure what formula you want to implement.

    Could you describe the formula? Not your implementation of the formula but its description.

    Best regards.

    Thread Starter momo2105

    (@momo2105)

    Hi

    i have find the solution like this:

    (function(){

    if(fieldname1 == “ECB” && fieldname2 == “RD”) return 165;

    if(fieldname1 == “ECB” && fieldname2 == “RD” && fieldname4 == “D”) return 315;

    if(fieldname1 == “EHB” && fieldname2 == “RD” && fieldname4 == “D”) return 750;

    if(fieldname1 == “EHB” && fieldname2 == “RD” && fieldname3 > 250) return 300;

    if(fieldname1 == “EHB” && fieldname2 == “RD” && fieldname3 < 250) return 250;

    })()

    all work only one not

    this:

    if(fieldname1 == “ECB” && fieldname2 == “RD” && fieldname4 == “D”) return 315;

    i dont have for now the online version i only test what is possible made with the CFF

    Plugin Author codepeople

    (@codepeople)

    Hello @momo2105

    A return instruction returns the equation value, ignoring the remaining equation instructions. For this reason, the order of the “if” conditional statements matters. You must enter the “if” from more specific instructions to more general. So, you must swap the first and second conditional statements:

    
    if(fieldname1 == "ECB" && fieldname2 == "RD" && fieldname4 == "D") return 315;
    
    if(fieldname1 == "ECB" && fieldname2 == "RD") return 165;
    
    

    Best regards.

    Thread Starter momo2105

    (@momo2105)

    Hello @codepeople

    thank you very much now work.

    Can you plese help me also with this?

    When i have very specify range in the Number field

    if(fieldname1 == “EHB” && fieldname2 == “IB” && 5000 < fieldname3 < 10000) return 1600;

    if(fieldname1 == “EHB” && fieldname2 == “IB” && 1500 < fieldname3 < 5000) return 850;

    if(fieldname1 == “EHB” && fieldname2 == “IB” && fieldname3 < 1500) return 400;

    dont work ??

    Plugin Author codepeople

    (@codepeople)

    Hello @momo2105

    When you need to check if a value is in a range, you must compare the value with the edges connected by an AND operator (&&).

    Ex.

    if(fieldname1 == "EHB" && fieldname2 == "IB" && 5000 < fieldname3 && fieldname3 < 10000) return 1600;

    However, in this specific case, if you include the “if” conditional statements in the correct order, you don’t need to check the range, only the max edge.

    
    if(fieldname1 == "EHB" && fieldname2 == "IB" && fieldname3 < 1500) return 400;
    
    if(fieldname1 == "EHB" && fieldname2 == "IB" && fieldname3 < 5000) return 850;
    
    if(fieldname1 == "EHB" && fieldname2 == "IB" && fieldname3 < 10000) return 1600;
    

    Best regards.

    Thread Starter momo2105

    (@momo2105)

    Hi @codepeople,

    Yes is true, you are the best! great support! i will recommend you product to any person!

    About Submit Button and send data to email is possible only from Professional Plan?

    thank you

    Plugin Author codepeople

    (@codepeople)

    Hello @momo2105,

    Yes, I’m sorry, these are commercial features. The following page contains a comparison of the different plugin distributions:

    https://cff.dwbooster.com/download#comparison

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘More “IF” in calculate field’ is closed to new replies.