Cognito Forms – Calculating Fields in Confirmation Email

cognito-forms

Is it possible to:

  • Set a number value for a dropdown, but don't show it in the UI (can be in the source)?
  • Take the values from the multiple fields and multiply/add them and send the output in the confirmation email?

Looking to create a form that people can fill out and send them the quote in an email and not present them the pricing right away.

Best Answer

I am a developer for Cognito Forms.

Although we don't have the ability to hide the price attached to a choice field, you can use a Calculation field.

I used a simple Choice field and a number field as shown below.

enter image description here

Next I added a Calculation field and gave it a simple name, I then set this field to show "internally" or "never". The calculation you will need to add to this field is below:

=(Choice = "First Choice" ? 10 : Choice = "Second Choice" ? 20 : Choice = "Third Choice" ? 30 : 0) * Quantity + " " + "Dollars"

This will take the choice option and assign it a numeric value (eg. 10, 20, 30) and then multiply that number by the number in the Quantity field. I am then adding the word "Dollars" to the end, this is to show that extra text can be added after the value has been calculated.

You can then navigate into your Submission Settings and enable the Confirmation option. You will need to be collecting the users email address so that you can assign the email field using the drop down under "To". In the message text block you can place your hidden Calculation field in your message, like this:

enter image description here

This will result in an email being sent to your user that looks like this:

enter image description here