• Resolved luisef

    (@luisef)


    IH
    I’m trying to get that an IF operation returns the string of one other IF operation if the result of one other filename returns a specific value.
    Basically it must return the result of the IF filename 26 if the filename 25 returns 1, or the IF filename 27 if the filename 25 returns 2 or the IF filename 28 if the filename 25 returns 3.
    I’m using with no success:
    (function(){
    switch(fieldname25){
    case 1: return fieldname26
    case 2: return fiedname27;
    case 3: return fieldname28;
    case 0: return ” “;
    }
    })()
    Can you help me?
    Regards

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter luisef

    (@luisef)

    Sorry, I’ve forgotten to tell you that I’ve already correct the missing “;” on case one and that case 1 and case 3 return a number instead of the text. Those numbers are included in the text of each one of the hypotheses.

    Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    Your equation is correct, you have simply forgotten a semicolon symbol after the fieldname26:

    
    (function(){
        switch(fieldname25){
            case 1: return fieldname26;
            case 2: return fiedname27;
            case 3: return fieldname28;
            default: return "";
        }
    })()
    

    Best regards.

    Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    Please, indicate the URL to the web form to check it in action.

    Best regards.

    Thread Starter luisef

    (@luisef)

    Hi
    The url:
    https://epadb.com/cat-for-reviews-and-rcts/
    Fielname25 is “total 1”
    The IF function to return the final result is “IF A+ ou A ou B”
    Thankyou
    Regards

    Thread Starter luisef

    (@luisef)

    Numbers returned Instead of the text, are the case1 of each of the IF hypothesis.

    Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    The form you sent me as reference does not include the equation in the initial entry. However, if you want to get the raw values of the fields, I recommend you to use the |r modifier, as follows:

    
    (function(){
        switch(fieldname25){
            case 1: return fieldname26|r;
            case 2: return fiedname27|r;
            case 3: return fieldname28|r;
            default: return "";
        }
    })()
    

    Best regards.

    Thread Starter luisef

    (@luisef)

    Hi
    It seams thas working fine now, however, one other problem as coming up.
    I have a field Total) to return a simple addition (fieldname3+fieldname4+fleldname17+fieldname22), that simply stops working. Yesterday was working fine.

    Thread Starter luisef

    (@luisef)

    Fields 26, 27, and 28 work upon the result of this field 14 (total).
    Regards

    Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    There is a typo in your equation. The correct would be: fieldname17

    I’m sorry, but the support service does not cover debugging the users’ projects. If you need a personalized support you need contact me through my private website: Contact Us

    Best regards.

    Thread Starter luisef

    (@luisef)

    Ok
    Thank you once again for your support.
    Best regards

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘IF to return an other IF funtion’ is closed to new replies.