How do I have a field complete a math function before it is selected.

  • Profile Image
    rsciascia
    Asked on August 19, 2025 at 4:49 PM


    Example, I have some math formulas in this form that will calculate the "Calculated Margin" field based on cost and sell. I don't see the results until I actually click on the Calculated Margin Field. I would like to to just populate automatically.


    How do I have a field complete a math function before it is selected Screenshot 20

  • Profile Image
    Eiron_O JotForm Support
    Replied on August 19, 2025 at 5:32 PM

    Hi Ron,

    Thanks for reaching out to Jotform Support. The issue is happening because of one of your conditions. You're trying to trigger the condition when the Margin % field is empty, and then populate it on the same field, which contradicts your trigger condition. See screenshot:

    How do I have a field complete a math function before it is selected Screenshot 40

    To fix this, you need to add another field where you will populate the result of the calculation. Let me show you how:

    1. In Form Builder, add another field for the result of the calculation. In this case, I duplicated one of your fields.
    2. Go to the Calculated Margin % condition, and change the Summary to the result field.

    How do I have a field complete a math function before it is selected Screenshot 51

    Here's the result:

    How do I have a field complete a math function before it is selected Screenshot 62

    That's it. Give it a try and let us know if you need any more help.

  • Profile Image
    rsciascia
    Replied on August 19, 2025 at 6:05 PM

    Thank you, that worked and I also have one more math question for the same form. The Turn and Earn Results calculated field isnt working correctly because of the following:


    The excel formula is : as follows:

    12/(Requested Stock Qty/Monthly Usage)*Calculated Margin

    I tried to use the same formula, but when i add the parentheses in the equation above I get an error.

    If i don't use the parentheses the calculation isn't correct

    How do I have a field complete a math function before it is selected Screenshot 20


  • Profile Image
    Mark Alan JotForm Support
    Replied on August 19, 2025 at 7:00 PM

    Hi Ron,

    Regarding your question about using parentheses in your formula 12/(Requested Stock Qty/Monthly Usage)*Calculated Margin in Jotform's calculation field, the error occurs because parentheses typed using your keyboard are added as text strings by default, which causes the formula to fail.

    Use the Formula Keypad's parentheses buttons instead of typing them directly on your keyboard. Parentheses added via the keypad are recognized as numerical operators, not text. Ensure all form fields are added with their curly brackets, e.g., {Requested Stock Qty}, {Monthly Usage}, {Calculated Margin} and that they are set to be treated as numbers 0-9 in the formula editor. See the screencast below:

    How do I have a field complete a math function before it is selected Screenshot 30

    Writing the formula using the calculator will correctly calculate using parentheses to control the order of operations without errors. See the screencast below for my results:

    How do I have a field complete a math function before it is selected Screenshot 41

    Reach out again if you have any other questions.