Blog

Using conditions

Posted by:

You are here:
← All Topics

Sometimes you will want to add conditions to your formulas, for example you might want to use different calculations depending on what options in your form are selected.

if(Condition)
  operation
else
  operation

Example:

The condition above will check the value of the dropdown, if the “Option 1” is selected the formula value will be 1, otherwise it will be 2.

The else section is optional, if you want you can create many conditions like this:

In the example above the formula value will be 1 if option 2 is selected, 2 if option 2 is selected or 3 if option 3 is selected.

You can also do arithmetical operations inside the conditions for more complex calculations:

Or even add conditions inside other conditions:

Creating multiple comparisons

You can also create multiple comparisons using && (for and) and || (for or). In an “And” comparison all the comparisons need to be true in order for the condition to be executed in an “Or” comparison at least one comparison needs to be true.

for example, if you want to compare if a number is greater than 10 AND lesser than 20 you can use this comparison:

alternatively, if you want to compare if a number is either 10 or 20 you could do so using the “Or” comparison

0

About the Author:

Im programmer working for an international company. I have programmed since i was 12 and i have done it professionally for 6 years. Programming for a company is fun and i have learned a lot of things but i have always been interested in running my own business so i decided to give it a shot doing what i do best, programming stuffs.
  Related Posts
  • No related posts found.