Assigning Numeric Values to Choice Fields!

Nadia A. By Nadia A. | March 7, 2017

Dialog box that assigns numeric values to Choice fields.

We’re excited to reveal a new Choice field enhancement: the Assign Values option! Similar to the Assign Prices option, this enhancement gives you the ability to assign numeric values to each option in a Choice field. Whether you want to build a quiz for your students, or screen prospective tenants for your rental property, there are a variety of scenarios in which these values can really come in handy!

Assign Values

Previously, in order to assign values to a Choice field, you had to manually assign the values using if/then statements:

(if HowIsYourCredit = "Good" then 1 else 0)

Now, however, you can simply add that value directly to the choice option; just select Assign Values from your Choice field settings, and enter values for any (or all) of your choice options:

A Choice field with assigned values.

The value can be positive or negative, and can even include decimals.

Calculate Values

Now that you’ve assigned your choice values, you can directly target them in calculations by denoting the Choice field’s name followed by _Value:


Based on the choice option selected, the Value attribute will display the corresponding numerical value. For example, if you’re creating a quiz, start by adding a Calculation field to your form (make sure that it’s set to Internal view only). Next, just add up each question’s value to calculate a total score:

=Question1_Value + Question2_Value + Question3_Value

To display the total to your students, insert your Calculation field into your form’s confirmation message:

A Calculation field inserted directly into the form confirmation message.

You could also use an if/then statement to display a specific message depending on the total score:

=if TotalScore = "10" then "Great job!" else ""

Have any questions about assigning Choice field values? Feel free to contact us or leave a comment below!

Nadia A.

Nadia A.

Nadia, the Technical Writer for Cognito Forms, develops documentation, support content, and how-to videos. No matter your experience – with her help, you'll be able to take full advantage of the product. In her spare time, Nadia enjoys listening to French house, drinking coffee, and talking about herself in third person.