Column Values as Outputs in the If โ†’ Then โ†’ Else Column

May 26, 2021

When you configure components, computed columns or conditions โ€“ย you're always dealing with values. The most common type of values are Column Values and Custom Values.

The If โ†’ Then โ†’ Else Column allows you to produce new values based on a set of conditions. You can have multiple 'cases' and each of these cases has a condition and an output value if the condition is met.

The configuration for the If โ†’ Then โ†’ Else Column

The simplest and most common way to use this column is to test for a value and then output a Custom Value. For example;

if the value in the Price column is below 10 then output the value 'low'.

However, each case's output value can also be a Column Value. There are many reasons and use cases for this, but let's look at two of the most common.

Outputting a value for a relation

For example, in this app, we have an If โ†’ Then โ†’ Else Column which tests for the custom value of 'true' and then outputs a column value from the row that is being evaluated.

In other words, if an item is active then the Property ID will be shown. We can then use that value elsewhere โ€“ for instance in a further Relation. Our new relation will only pull back those rows that have values in them.

Thanks to Robert Petitto for this technique!

Outputting a value for a calculation

Another example would be in a calculation. Say we had an inventory log โ€“ย with sales items out and restocking items in โ€“ and we wanted to sum the total of all the sold items in the log (but not the restocking items).

To do this, we can create an If โ†’ Then โ†’ Else column which will show the order total only if the Sale or Restock column contains the value 'Sale' and shows the value of 0 if not. We can then use that column elsewhere in a calculation, rollup or chart.