How to use form calculation to get the product of the fields and include a currency in the outcome

  • Ringle
    Asked on March 28, 2023 at 12:05 PM

    I've created the above form.

    You'll see that I've created eight (8) item sections. Under each of those items, I show a field "EXT. $'s" I'd like to take the QTY in each respective field, multiple it by the UNIT $, and put the product of that calculation in the EXT. $'s box for that respective ITEM. I'd also like both the UNIT $ and EXT. $'s fields be in U.S. currency.

    The other thing I'd like to do is add those EXT. $'s figures, from each respective ITEM section, and put that sum in the field at the end of the form titled "Order Total $'s." Ideally, I'd like that particular label to be centered in the form, and again be in U.S. currency.

    I'm not real computer literate, so if you could "dumb down" the solutions, I'd appreciate it.

    Thanks



  • Victorino_S JotForm Support
    Replied on March 28, 2023 at 1:33 PM

    Hi Robert,

    Thanks for reaching out to Jotform Support. Here's how to use the Form Calculation widget to calculate the product of those fields:

    • Select the EXT. $'s field and click the Wand icon to open the Widget Settings.
    • In the calculation, clear the created calculation, enter the $ sign in the calculation, then select the Add field button.

    1680024206 6423228e0a2b7  Screenshot 10

    • Select the QTY field, then click the Multiplication icon, then click the Add field button again, and finally select the UNIT $ (if known) field.
    • Click Save.

    1680024363 6423232bf2016  Screenshot 21


    • Do the same process for the other items.


    As for your other question, to get the total amount for all the EXT fields, you can change the Number field to a Form Calculation widget. Then, create a calculation to add the EXT fields to get the sum. Here's an example calculation:

    1680024824 642324f852d17  Screenshot 32


    We also have a guide about How to Perform Form Calculation Using a Widget that you can check out.

    Let us know if you need any more help.

  • Ringle
    Replied on March 28, 2023 at 2:40 PM
    I followed the instructions explicitly and saved each new "Item"
    calculation (all 8). However, when I previewed the form, the item 1
    calculation worked just fine. When I tried a different set of figures for
    item 2, as soon as I added a quantity figure, it immediately returned the
    same total number (EXT $'s) as item 1. Even if I changed the quantity and
    unit $, it still yielded the item 1 figure.
    ...
  • Victorino_S JotForm Support
    Replied on March 28, 2023 at 4:06 PM

    Hi Robert,

    Thanks for getting back to us. Sorry for the misunderstanding, but when I said to repeat the process for the other items, I meant to add the matching QTY and UNIT $ fields to the item you are working on. Basically, if we need to get the product calculation for ITEM 2, you must add the QTY and Unit $ fields from ITEM 2 rather than ITEM 1. Checkout my screencast below to see my results:

    1680033927 6423488749197  Screenshot 10


    Give it a try and let us know how it goes.

  • Ringle
    Replied on March 28, 2023 at 4:40 PM
    Yes, I understood. That is what I did.
    I started with item 1, highlighted the EXT $'s field, and then multiplied
    the quantity field by the unit $ field. I then went to item 2, highlighted
    that EXT $'s field for item 2, and then multiplied the quantity field (in
    item 2) by the unit $ field (in item 2 again). I went through that process
    for all 8 items, each time using the fields only in that respective "item."
    Each time I saved the formula.
    Then, when I completed all of that, I decided to try out the formulas by
    previewing the form.
    For item 1, when I put in example figures for the "qty" and "unit $"
    fields, the calculation in the "Extd $'s" was correct. However, when I got
    to item 2, it was a different story. I put in a quantity figure in the
    "qty" field and it immediately placed the same total from item 1 in the
    "Ext'd $" field." I tried to clear it out, but the same thing repeated
    itself. When I went to item 3, the same thing occurred ... item 1's Ext'd $
    figure appeared.
    ...
  • Victorino_S JotForm Support
    Replied on March 28, 2023 at 6:44 PM

    Hi Ringle,

    Thanks for getting back to us. I’m sorry you're having difficulties with this. Unfortunately, upon checking your form, it seems that calculations are the same for item 2 onwards. Could you please use a different browser or incognito mode, then clear all the calculations from item 2 to item 8, and then redo the calculation correctly again? Please make sure to click the Save to update the changes.

    Give it a try and let us know how it goes.

  • Ringle
    Replied on March 29, 2023 at 7:45 AM
    Your recommendations were unsuccessful. I even tried starting with Item 3,
    and though the formula had been saved correctly, an example unit $ figure
    and quantity yielded no answer at all in the EXT'D $'s field. However, I
    could go back to item 1, and the calculation worked correctly.
    It appears the problem is on JotForm's end. Can you please further
    investigate this problem and identify a robust solution? I need to launch
    this form internally, but obviously am unable to do so because of this
    obstacle.
    Thank you!
    ...
  • Shirized Ina Garces JotForm Support
    Replied on March 29, 2023 at 8:35 AM

    Hi Ringle,

    Thanks for getting back to us. I'm sorry this is happening. I reviewed your form and I noticed that for the rest of your Items, you're using the "QTY" Field and "UNIT $" Field under your Item 1 for all of your Form Calculations fields of every other Item. I would suggest temporarily changing the labels of those fields for the rest of your Items to avoid confusion. (Example: ITEM 2 = QTY 2 and UNIT $ 2). This way, you can easily determine which fields to add to your calculation for each Item. Take a look at the screenshots below for your reference:

    ITEM 2:

    1680092716 64242e2c81e55  Screenshot 10

    Please make sure to remove the Closing Bracket ")" in your calculation.

    1680092855 64242eb765c58  Screenshot 21

    ITEM 3:

    1680093060 64242f845c89c  Screenshot 32

    Then do the same process for Items 4-8.

    Here's the result:

    1680093238 64243036bf4b6  Screenshot 43

    Give it a try and let us know how it goes.

  • Ringle
    Replied on March 29, 2023 at 11:05 AM
    I finally got it to work by assigning a unique identifier to each of the
    affected fields as you had suggested. For example, the qty, unit $, and
    ext'd $ fields in item 1 have an (a) suffix after them. In item 2, those
    same fields now carry a suffix (b), item 3 with a suffix (c), etc.
    It's not a perfect situation, but the workaround does solve the bigger
    problem.
    Thank you for your continued support through this challenge!
    ...
  • Ringle
    Replied on March 29, 2023 at 12:10 PM
    Unfortunately, in having some of our users "test" the form, we've run into
    another problem.
    The "description" field is a required one, so that is indicated on the form
    (*) for each of the 8 items. According to one user, they were testing the
    ability to order just 1 item. However, it kept throwing an error message
    until they put at least 1 character in the description field for each of
    the 8 items. That won't work. Generally, most of our users will only be
    ordering 1 or 2 items, so they certainly don't want to needlessly be
    putting characters in the remaining item description fields, when that
    action is of no value.
    Suggestions?
    Thanks

    ...
  • Shirized Ina Garces JotForm Support
    Replied on March 29, 2023 at 1:03 PM

    Hi Ringle,

    Thanks for getting back to us. To avoid confusion, I've moved that to a new thread. You can check that out here.

    Let us know if there’s anything else we can help you with.