Articles in this section
Category / Section

9.4 Set Valve Based On User`s Selection

Published:
Updated:

An often used scenario in a form is having the user select between various options and then setting a specific value based on that selection.

In this simple example we sell two types of merchandise, type A and type B. The price of A is 10, and B is 20. We set this up in the form as follows:

941.png

In the Preview panel this setup looks like this:

942.png

In the Decimal element Price we use the following formula:

943.png

The values a and b of the element select_type are initially set to False/0. When one of them is selected, this is set to True/1.

When for instance B is selected, this formula calculates the Price to be 20. You can then use that Price value to perform other calculations, such as adding VAT.

944.png

Was this article useful?
yes
No
Help us improve this page
Please provide feedback or comments
Access denied
Access denied