Formulas (beta)
To define a formula column:
- Navigate to your table.
- Click "Add Column".
- Enter a name for the column.
- Select "formula" as the type of the column.
- Enter a formula.
- Click "Create Column".
Formulas may be invoked on either literal values (e.g. 3, "hello"), or they may reference columns by name. The following formulas are supported:
- UPPER(text). Converts text to uppercase.
- CONCATENATE(text). Concatenates multiple text values.
- EQ(value1, value2). Evaluates to true if the values are equal.
- IF(condition1, value1, ..., default). Evaluates one or more conditions, returning the value for the first condition that evaluates to true, or if none evaluate to true, the default value.
- IN(text, text[]). Evaluates to true if the provided text is found in the provided list.
- NOW(): Returns the current date and time.
- SUBSTITUTE(haystack, needle, replacement). Returns
haystack
with all occurences ofneedle
replaced byreplacement
.
Limitations
Formulas are a beta feature that may be buggy and incomplete. We plan to extend the formula system
- Formulas may only be used inside of columns of type "formula".
- Plato provides no error reporting for invalid formulas.
- Plato provides no typeahead support for helping you define your formulas.