How to get user input number from a number option

Number options allow users to input a number.

Typically, you’ll want the number set by a customer to be the value for the number option. This is actually different than how other options work in the system. Because using the customer input as the value is the primary use case, we have automated the set up for you.

When creating a new Number option, it will initially look like this:

The check box titled “Set the customers input number to the value of this option” is what automates the configuration of the option so it will hold the number entered by your customers.

After saving a number option with this box checked, it will look a bit different the next time you edit it.

You will see the following instead:

<uniquename>.inputvalue will get the customer input number.

You can also use this same variable when referencing number options outside of the number option itself. You could use this variable in a Unit Price Calculation or another option formula.

Number option with the unique name length

  • Including “length” in a calculation would return the option value. The option value might not be the customers input value. It could be a fixed value you set or a result of an unrelated calculation.
  • Using length.inputvalue in a calculation would return the user input number.
  • Setting option value to the user input value. Set the number option formula to length.inputvalue

    This will make the calculated value for the option equal to the number input value. Now you can use the variable length inside an Calculator Unit Price Calculation.
  • Lookup a price from user number input.

    In this example, dimensions is a pricing table.

    An arbitrary constant is used as the first input. This just finds the same column every time.
    length.inputvalue is used as the secondary input in the pricing table lookup. This means we will find a row matching the user input number value.