• Resolved hheyhey568

    (@hheyhey568)


    Hello Team,
    One query : I want to make if else statement of excel into CFF as follow:

    If(fieldname1==”User” Variable1=fieldname2 else Variable1=fieldname3)

    How to get this done in CFF? Please help

    regards,

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    Thank you very much for using our plugin.

    There are multiple alternatives.

    You can use the IF operation distributed with the plugin:

    IF(fieldname1=="User", fieldname2, fieldname3)

    Another alternative is the javascript ternary operator:

    fieldname1=="User" ? fieldname2 : fieldname3

    Or you can use a function structure and the if conditional statement. Javascript is a case-sensitive language, please, do not confuse the IF operation with the if conditional statement:

    (function(){
    if(fieldname1 == "User") return fieldname2;
    else return fieldname3;
    })()

    Actually, the else clause in the previous equation is redundant, it can be rewritten as follows:

    (function(){
    if(fieldname1 == "User") return fieldname2;
    return fieldname3;
    })()

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘If Else Statements’ is closed to new replies.