I'm trying to create a calculation based on the "Yes/No" toggle field where "Yes" would add a cost to a Calculated total at the bottom.

I understand in general how to do calculations with checkboxes, but what is the code to use for the calculation to identify the toggle field in a section?

1 Answer 1


I am a developer with Cognito Forms.

This can be done by using a Price Field. In the Amount area you are going to be adding a calculation that checks to see if the Yes/No field is true or false, it will then add a price depending on what value it finds.

This is the calculation used with the Yes/No field titled "Yes No".

=YesNo ? 10 : 20

With this calculation the Yes or True value will be set to 10$ and the No or False value will be set to 20$.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.