 # Insert if/else column

Adds a conditional new column via "if" conditions

### Adding conditional logic with If Else

A conditional statement is a core building block of any programming language. In Parabola, these are Insert if/else column steps.

The goal of each Insert if/else column step is to create one column - the value of each cell in that column is dictated by the rules in the step.

That means you need a few things:

• A column name
• A default value if no rules match

Technically that is all you need, but with only a default value and no rules, an Insert if/else column step will just create the same default value in every cell of the new column.

That means that most proper uses of the Insert if/else column step also includes at least one rule.

### A refresher on If Else logic

If Else logic usually looks like this:

If (A=1)
Set B=20
Else If (A=2)
Set B=30
Else
B=0

Which can be generalized to:

If (Condition is true)
Do something
Otherwise, if (Other condition is true)
Do something else
Otherwise if nothing is true

### How Insert if/else column step settings are used

This is how you would map Parabola Insert if/else column step fields to the above example:

Column Name is where the result will go, by default it will be set to the Default Value, which is the Do the default task of the Otherwise if nothing is true section, or the B=0 of the final Else block.

Each card represents a single If statement, or Else If statement (which is the same as an If). Not an Else statement.

In each card, you can set up the condition that will be evaluated to be TRUE or FALSE. That condition can be as simple as Does column A = 1? or more complicated as Does column A = 1 AND does column B not = 2 AND is column C Blank?. If you are using logical AND operators to combine all of your conditions, then they all need to evaluate to TRUE for the target column to be set to the value of the card. If you are using logical OR operators to combine all of your conditions, then only one rule needs to evaluate to TRUE for the target column to be set to the value of the card.

When using multiple cards, they are applied from the top down. The first card to trigger the target column to be set to a value will set the cell to that value and move to the next row, not evaluating subsequent rules. If a card is not evaluated to be TRUE, then Parabola will move on to the next card, and so on until one evaluates to TRUE or none do, in which case the default value is used.