How to Use Conditions for Calculations

  • sfranklin977
    Asked on December 7, 2020 at 7:49 AM

    I have a multiple selection field that includes a checkbox that would be checked if a credit card is used. When that box is checked I would like to automatically add 3% to the credit card processing fee field. How would I be able to take care of that?

    Jotform Thread 2749237 Screenshot
  • hestia Jotform Support
    Replied on December 7, 2020 at 9:06 AM

    Hello,

    For your information, to demonstrate the answer to your question I have cloned your form. Nothing has been changed in your original form.

    To add "3% Credit Card Processing Fee" to your "Total Amount" when the "Credit Card-3% Processing Fee" option checked, please follow the steps below:

    1. (Optional) If you prefer the "3% Credit Card Processing Fee" to be hidden if the Credit Card option is not chosen. You can click the gear icon (Properties) on the top of the "3% Credit Card Processing Fee" element and from the "Advanced" menu you can enable the "Hide field" option.
    2. From the top of the page, click the "Settings" menu, and go to "Conditions".
    3. In the "New Condition" menu, click "Add New Condition", and select "Update/Calculate Field".
    4. From the "IF" section choose the field "51. 3Deposit. Balance due upon installation".
    5. For the "STATE" section choose "Is Equal To".
    6. For the "VALUE" select "Credit Card-3% Processing Fee if used".
    7. From the "DO" section select "Calculate a field's value".
    8. Input the calculation for "3% Credit Card Processing Fee" which is 3% of Total Amount: Press the blue "Add Field" button from the right of the calculation window, and choose "Total Amount", and for multiplying it with 3% write "*3/100".
    9. In the "SUMMARY" section choose "3% Credit Card Processing Fee". Now, when the Credit Card option is chosen and the Total Amount is specified Amount Due will be automatically updated.

    1607348292 5fce3044635e7  Screenshot 10

    If you require more assistance, please let us know.






  • sfranklin977
    Replied on December 7, 2020 at 12:59 PM

    For some reason, it is still not calculating the value correctly and I a not sure why?

  • enterprisesupportteam
    Replied on December 7, 2020 at 4:10 PM

    Hello @sfranklin977,

    I have checked your form and it does seem that the calculations are working correctly. The Total amount due does get an increase when you select the 3% deposit option. Here is a screen recording for your reference:

    1607375179 5fce994b29a79  Screenshot 10

  • sfranklin977
    Replied on December 8, 2020 at 8:11 AM

    I am still coming up with the wrong value in the form as there appears to .09028 percent added that should not be there. I have created a video to show you. Thanks for the help.

    https://www.loom.com/share/104ecc6297cd4cb9a7bf135624bce63c

  • hestia Jotform Support
    Replied on December 8, 2020 at 9:06 AM

    Hi,

    Thank you so much for the video feedback. I have cloned your form and tested it on my end. The issue seems to be with the calculation in the condition for calculating "3% Credit Card Processing Fee". The "Amount Due" field has been entered in the calculation on your form, therefore the processing fee is not calculated right. As I see in your "Amount Due" calculation in your form (please see the screenshot below); you want to add the "processing fee" to the "total amount" and subtract the "deposit" from this value, and then reach the final amount which is"Amount Due". Hence, the "Total Amount" value should be used in the condition calculation of "3% Credit Card Processing Fee".

    1607435436 5fcf84ac54a44  Screenshot 10

    To edit the condition calculation for the right value, please follow the steps below:

    1. Go to your form and click the "Settings" tab on the top of the page.
    2. Click "Conditions" under the "Settings" menu.
    3. Then hold your mouse on the first line, the calculation condition which calculates the "3% Credit Card Processing Fee". Press the blue pen button "Edit" on the condition.
    4. Under the "DO" section, delete your existing calculation and input the calculation of "Total Amount*3%" as I demonstrated below in the screencast. Then, click "Save". Now when you preview your form you will see the "Amount Due" is being calculated correctly.

    1607435526 5fcf850663e47  Screenshot 21Please kindly give feedback to us if these steps do not solve the issue. And of course, you can always reach us if you require more assistance with any other matter.


  • sfranklin977
    Replied on December 8, 2020 at 10:20 AM

    OK, that worked! But what I need to do is rearrange the way it is calculated, now that we have that worked out. That rearrangement is my fault. What I am wanting would be for the Amount Due solution to be calculated from the total amount minus the deposit whether or not the 3% credit card processing fee is entered. Hope that makes sense and apologies for the confusion. Please also see a second video.


    https://www.loom.com/share/da7b28abdc774ddb92ce8edd09be5f41

  • hestia Jotform Support
    Replied on December 8, 2020 at 10:41 AM

    Hi,

    Thank you very much for your feedback. If the customer chooses another paying option; "3% credit card processing fee" will not be calculated thanks to the condition you used to calculate the processing fee. If a customer chooses payment options other than a credit card; your calculation for Amount Due will be just: Total Amount minus Deposit. Please see the below screencast, which includes the test I have did on a clone of your form:

    1607441893 5fcf9de559ab2  Screenshot 10

    If you require more assistance, please let us know.

  • sfranklin977
    Replied on December 8, 2020 at 2:29 PM

    OK - I think after this video we will have it correct. Thanks again for your patience and help!


    https://www.loom.com/share/efb95e9fcc764832acc38cb2f0e466ff

  • hestia Jotform Support
    Replied on December 9, 2020 at 9:38 AM

    Hello again,

    First of all, thank you very much for your feedback and the videos you shared. It is really helpful and much appreciated. If I understand correctly from your last video. You want to add the "3% processing fee" to "Amount to be paid today". Please be informed, I have cloned your form, and nothing has been changed on your original form. So if you can kindly follow the steps below, and see the screencast, I think you can have the calculations as you desired:

    1. Change the calculation for "Amount Due after Deposit" to; "Total Amount of Job" - "Depozit" as implied for the field. You should delete the 3% processing fee from this calculation.
    2. Then please add a "Form Calculation" widget to add a new field to calculate in case the credit card option is used (I have named the field as "Amount to be paid today (with Credit Card)"). This field calculation should be as "Amount to be paid today" + "3% processing fee". (If you wish to hide this field as "3% processing fee" and show it when the Credit Card option is chosen you can edit in the following order"Properties/Advanced/Hide" option. And add a condition to only show the field when the credit card option selected. Please see the screencast.)
    3. Of course, you should also change the Condition for 3% processing for this value to be added only to the "Amount to be paid today" if a credit card is used. So the calculation can be: "Amount to be paid today" + "3% processing fee". And after you did all these arrangements you will see that everything is in order as you mentioned in your video.

    screencast%202020 12 09%2017 07 54 Screenshot 10

    If you need further assistance, please let us know.




  • sfranklin977
    Replied on December 9, 2020 at 3:09 PM

    Ok, I have officially broken something. Can someone please watch this video and fix this for me based on the last support request. Thanks.


    https://www.loom.com/share/825308d833e342f0ba67963f2ff8a5e0

  • jonathan
    Replied on December 9, 2020 at 6:46 PM

    We apologize for inconvenience. I was able to see the issue you described from the video you shared.

    1607557469 5fd1615d605a8 zzz 2020 12 10 Screenshot 10

    Please allow me some more time to investigate and figure out a fix/resolution. I will update here after some time.


  • sfranklin977
    Replied on December 16, 2020 at 10:16 AM

    Can someone give me an update on the staus of this issue as I have not heard anything from anybody.

  • Kenneth JotForm Support
    Replied on December 16, 2020 at 11:09 AM

    Hi there,

    I checked the form and have found out that even though your Form Calculation Widget for the "3% Processing Fee" already has a formula, you still have a condition that inserts values on top of it:

    1608134467 5fda2f43ddf49 u1 Screenshot 10

    So I disabled the condition and applied the formula into the "3% processing fee" field:

    1608134558 5fda2f9e070b5 i1 Screenshot 21

    Here is the formula:

    1608134726 5fda30469ad9d f1 Screenshot 32

    Here is a screencast:

    1608134780 5fda307c380e2 Proposal Agreem Screenshot 43

    I hope that helps.

    Best.

  • sfranklin977
    Replied on December 16, 2020 at 11:19 AM

    No that doesn't as it is still not working correctly.

  • sfranklin977
    Replied on December 16, 2020 at 11:24 AM

    Please see the video link for an explanation.

    https://www.loom.com/share/e572874304f744cbaeebfb203b9f07ec

  • hestia Jotform Support
    Replied on December 16, 2020 at 12:45 PM

    Hello again,

    I apologize for the confusion and thank you very much for the video feedback. Please follow the instructions and see the screencast below:

    • Please go to the "SETTINGS/CONDITIONS" tab and delete the condition for calculating the "3% Credit Card Processing Fee" (please see the screenshot of the related condition below).

    1608138147 5fda3da3beacb  Screenshot 10

    • Then go to the "BUILD" tab, change the "3% Credit Card Processing Fee" field's calculation to --> "Amount Due after Deposit"*3/100 then click the "SAVE" button.
    • Please change the "Amount to be paid today (with Credit Card)" field's calculation to --> "Amount Due after Deposit"+"3% Credit Card Processing Fee" then click the "SAVE" button.
    • To show the customers the "Amount to be paid today (without Credit Card)" which is free of credit card processing fee; please go to "SETTINGS/CONDITIONS", click the "Add a new condition button", choose the "UPDATE/CALCULATE FIELD" option.
    • Select the "Balance due upon installation" field from the "IF" drop-down menu.
    • Select "Is equal to" from the "STATE" drop-down menu.
    • Select the "Cash" option from the "VALUE" drop-down menu.
    • Then click the blue plus icon next to the box we edited in these steps. In the new box that appeared; select the "Balance due upon installation" field from the "IF", select "Is equal to" from the "STATE" again, and select the "Check" option from the "VALUE".
    • Repeat the previous step for the "Financed*" payment option.
    • Then on the second box on that page; select "Copy a Field's Value" from the "DO" drop-down menu. Select the "Amount Due after Deposit" field from the "FROM" drop-down menu and select the "Amount to be paid today (without Credit Card)" field from the "TO" drop-down menu. Then click the "SAVE" button. Your condition should look like the screenshot below.

    1608139594 5fda434adc4fb  Screenshot 21

    Now all the calculations and conditions should be in order as you wished them to be. Please see the screencast below to see all the arrangements made:

    1608140482 5fda46c25c902  Screenshot 32Please kindly give feedback to us, if these arrangements are still not working for what you needed for your form. And feel free to reach us, if you have any other questions.

  • sfranklin977
    Replied on December 16, 2020 at 2:08 PM

    Absolutely Perfect!!! You guys rock! Thank you!!!!!!!