Which calculation method is more efficient, widget or conditional logic?

  • Profile Image
    Asked on April 21, 2017 at 11:49 AM

    I have used both methods of doing calculation (i.e. Conditional Logic or Form Calculation widget). Is there a benefit or drawback to one over the other? Is there any discernible efficiency as far as speed or managing the code?

    This is a re-post of a comment on How to Perform Form Calculation Using a Widget

  • Profile Image
    Answered on April 21, 2017 at 01:18 PM

    Well, I wouldn't say there is some significant difference between those two methods when it comes to speed of calculating. 

    If you use the widget it will be slightly easier to just add the fields and then add the math functions. Also, if you want to use Calculation values assigned to options, for example to Radio buttons or Checkbox buttons, you will use the widget. Also, if you want to pass the calculated value to Payment you will use the widget.

    The conditional logic calculation method is good if you want to calculate something based on the value of some other field, for example, "if user entered value in that field calculate something". 

    Bottom line, both methods have advantages it just depends on how you want to calculate in the form, but the speed is the same and you need almost the same effort to manage that.

    Hopefully, I was able to answer your question.

    Let us know if you have any further one.

    Thank you!