# Update/Calculate Field Condition: Having problem when calculating the Price

• KKPerry
Asked on January 03, 2017 at 11:09 PM

Last year we had a successful form for Mulch sales that had tiered pricing based on quantity ordered. The Paypal Payment field allowed for a check box for the tier, and then we used a dropdown box to constrain the choices and the total payment was successfully calculated.

This year we would like to provide a Pay by Check in addition to Paypal. I read several guides and forum responses about how, in theory, to calculate the Order Total and then I plan to set up the conditional logic to pass this to a new Paypal payment field, or display instructions for sending a check (I haven't even gotten to that logic yet).

I am having trouble with the Form Calculation field. My form currently is attempting 2 different approaches. The first I tried to use a quantity field for any number of bags, and then was going to use the conditional logic to insert a calculated field. First of all even for a single calculation, the decimal points are not being used in the calculation. For example, 10-24 bags are priced at \$5.75 a bag. My Total field shows .75 regardless of number of bags, and the calculation is only based on the whole number. And when I try to use 2 conditions (if Bags of Mulch is less than 25 then multiple Bags of Mulch by 5.75; if Bags of Mulch is greater than 24 AND less than 50 then multiple Bags of Mulch by \$5.25) - this results in 2 numbers being displayed with 2 decimal points (for example 50.75 25.00) FYI I have not inserted all of the proper values as I can't get it he first tier to work.

In a second attempt I started to build individual drop down boxes with the manual calculated Calculated Value and this appears to work, but seem like a lot of data entry and probably would need additional condition logic. In additional greater than 150 bags is \$4.50 so instead of all the endless possibilities, I was hoping to multiple that option.

Please help point me in the best direction - I really tried to research myself, but I am clearly still missing something.

Thank you for your assistance.

• candy
Answered on January 04, 2017 at 04:00 AM

Hello,

I have checked your form and cloned it in order to test it on my side. I have experienced the same issues.

First of all, when I have set "1" to the field of "Bags Of Mulch", I have seen a weird price as you have already mentioned in the Order Total Field as you can see the screenshot below:

I have seen that you have 2 conditions related to "Order Total" field. When the Bags of Mulch field is greater than 25 and less than 25. I have seen that there is an issue that the field does not recognize the second condition when the bags of Mulch less than 25 and do not calculate the price. So that, I have forwarded this issue to our software development team in order to check it. You are going to be informed via this thread.

Moreover, I have realized that you have set a normal text box field instead of a Form Calculation widget for the Order Total field. I recommend you to use the Form Calculation widget as the following screenshot below:

In my example, as a quick solution I have applied the following steps:

The first Calculation widget calculates theBagNumber*5.25

The second Calculation widget calculates theBagNumber * 5.75

Make the calculation widgets invisible on the form(Hide them).

You can set a condition about when the Bag Number less than 25 show the first form calculation widget and when more than 25 show the second calculation widget.

You can also pass the values to payment field via conditions as you can see the example below:

Please try this solution.

Related to your second approach, If you prefer to do this with drop down list, you need to set too many conditions as you have already realized. So that, I recommend you not to use drop down list for this kind of calculations.

Thank you.

• candy
Answered on January 06, 2017 at 02:18 AM

Hello again,

I have checked your form again. I have understood the reason of a weird price such as "5.00.75.00" in the Order Total Field.

Please click on the "Preferences" tab in the Form Builder and find "Clear Hidden Field Values" in the "Advanced" tab of the Preferences menu. After, please set as "Clear On Being Hidden" to the Clear Hidden Field Values Option as you can see the screenshot below:

After doing this, your calculation in the "Order Total" field, will be calculated true as you can see the screenshot below:

Moreover, I had seen that you have tried to set a separate text box fields for each price. You do not have to do that. You can set just a text box value and set conditions for each price. After, you can set a Form Calculation to pass the value to the payment field. I have checked your current form and I have seen that you have made a lot of changings since then. So, I am not able to show you this example on your form, for now.

If you need further assistance, please let us know.

Thanks.