Gallery
Kuovonne's Guide to Airtable
Share
Explore
Kuovonne's Guide to Airtable
Specific Formulas

List Fields Values (one per line) with Optional Fields

Thank Kuovonne for creating this content!

Inspiration

A user has five free-form data fields. All five fields are optional. The user wants to create a formula to consolidate the information from all five fields, one per line, without any blank lines.

Discussion

Here is the basic formula format. The user actually wants two new line characters \n\n between each field, but I am including only one in this formula.
TRIM(CONCATENATE(
IF({field1}, {field1} & "\n"),
IF({field2}, {field2} & "\n"),
IF({field3}, {field3} & "\n"),
IF({field4}, {field4} & "\n"),
IF({field5}, {field5} & "\n")
))

This formula works by checking each field if the field has a value, and if it does, combining the field value with a new line character. The CONCATENATE() combines all of these values and new line characters. Finally, any trailing line break is removed with TIRM().
Note that the final IF function combines the field value with the new line character, even though this last one will never be used.
It is easier to rearrange the order of the fields. Changing the order of fields only involves moving the lines and adjusting commas without also having to adding or removing the newline character.
Keeping the parallel structure for all the fields makes the formula easier to read and understand.

Thank Kuovonne for creating this content!
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.