• Resolved morriscey

    (@morriscey)


    Hey there – thank you for the awesome plugin.

    Just having a little trouble making it work how I need it to work. Once I have it the way I need it the client is going to buy the full version for email functionality.

    The first issue is

    When the user puts a checkmark in “design incluido” I need it to display the message
    “O design possui um custo adicional. Faremos contato com você em breve para apresentar a cota??o completa.”

    Currently I have it displaying the message – but it’s only a single line and gets cut off – I need it to display multiline. I found a different tutorial for multiline result fields but I wasn’t able to make it work.

    it also displays the box regardless of if the message is needed or not. Ideally if they don’t check the option the box doesn’t display.

    My second issue is getting it to display a sentence with multiple values.

    I would like it to say “You can get (calculated result) (fieldname7) for R$(fieldname2)”

    Thank you for your help

    The page I need help with: [log in to see the link]

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

    (@codepeople)

    Hello @morriscey

    Responding to the first question, the process would be simpler by using dependencies. Insert an “Instruct. Text”, or “HTML Content” field with the instructions for the user, and configure this field as dependent on the checkbox field. More information about dependencies by reading the following blog post:

    https://cff.dwbooster.com/blog/2020/03/01/dependencies

    About your second question. If you want to generate a composed answer, you can use the CONCATENATE operation.

    I’ll try to describe the process with a hypothetical example. Assuming the current equation is: fieldname1+fieldname2

    You can edit it as follows:

    
    CONCATENATE('You can get ', SUM(fieldname1,fieldname2), ' for R$', fieldname2)
    

    If the text is too long and you prefer to use the calculated field as an auxiliary field but display the result into another field:

    You can insert an “HTML Content” field with a div tag where display the result as its content: <div class="result-here"></div>

    And edit the previous equation as follows:

    
    (function(){
    var result = CONCATENATE('You can get ', SUM(fieldname1,fieldname2), ' for R$', fieldname2);
    jQuery('.result-here').html(result);
    return result;
    })()
    

    Finally, since the calculated field is used as an auxiliary field, it is not essential for the form’s interface. So, you can hide it by ticking a checkbox in its settings.

    Best regards.

    Thread Starter morriscey

    (@morriscey)

    OK Great thank you I have it very close.

    I got it to display the message when they check the checkbox, but it displays immediately, instead of when they click calculate.

    I think I’d rather have it display the text “O design possui um custo adicional. Faremos contato com você em breve para apresentar a cota??o completa.” in the concatenated text, at the end if that check box is selected.

    I tried setting the value of the checkbox to the text I want, but it still displays “0” as the default value. How would I hide the zero? or properly include that text based on a checkbox?

    Thank you for all your help.

    Plugin Author codepeople

    (@codepeople)

    Hello @morriscey

    If you prefer to concatenate the text at the end of the result if the checkbox is ticked, instead of using dependencies, you can do something similar to:

    (function(){
    var result = CONCATENATE('You can get ', SUM(fieldname1,fieldname2), ' for R$', fieldname2);
    
    if(fieldname8) result = CONCATENATE(result, ' O design possui um custo adicional. Faremos contato com você em breve para apresentar a cota??o completa.');
    jQuery('.result-here').html(result);
    return result;
    })()

    If you want to evaluate the previous equation only after the user enters the values into the fields fieldname1 and fieldname2, the equation can be edited as follows:

    (function(){
        var result = '';
    
        if(AND(fieldname1, fieldname2))
        {
            result = CONCATENATE('You can get ', SUM(fieldname1,fieldname2), ' for R$', fieldname2);
    
            if(fieldname8) result = CONCATENATE(result, ' O design possui um custo adicional. Faremos contato com você em breve para apresentar a cota??o completa.');
        }
    
        jQuery('.result-here').html(result);
        return result;
    })()

    Best regards.

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