Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Line breaks in formulas

cancel
Showing results for 
Search instead for 
Did you mean: 
Matt_Sayward
8 - Airtable Astronomer
8 - Airtable Astronomer

I’m using Airtable to plan some PPC campaigns. I have a formula concatenating a bunch of different keyword sets, which reference the product name from an earlier field in the record.

Google AdWords prefers to have each keyword set on a new line.

Is there any way I can produce a line break in the formula output so that each can be pasted straight in?

19 Comments
Matt_Sayward
8 - Airtable Astronomer
8 - Airtable Astronomer

You could wrap the formula in this:

SUBSTITUTE([Formula here], "\"", "")

W_Vann_Hall
13 - Mars
13 - Mars

A couple of notes:

  1. If you copy and paste from the formula field into a long text field, the first four lines of the field will display in gallery and kanban views.

  2. With the new ability to change line height in grid views, the first six lines of a formula field with embedded ‘\n’ characters can be shown when line height is set to ‘extra-tall.’ Presumably this is the same for long text fields, as well; however, unlike the use with gallery and kanban views mentioned in item 1, the value does not have to be copy-and-pasted into a long text field first.

  3. ‘Extra-tall’ line height in grid views, as discussed in item 2, also applies to rollup fields created with the aggregation function ARRAYJOIN(values,'\n').

  4. The Page Designer Block will wrap formula or rollup fields with embedded ‘\n’ characters without requiring the field value first be copy and pasted to a long text field.

  5. In support of the functionality described in item 1, within the [Documentation] table of my Wardrobe Manager base is the ‘Wardrobe Manager Zapier Guide,’ providing step-by-step instructions for configuring a two-step (i.e., free) Zapier Zap to copy the value from a formula field and paste it into a long text field.

Gareth_Chapman
6 - Interface Innovator
6 - Interface Innovator

Hi Matt
I wrapped the formula as you suggested, but the outcome was the same…
SUBSTITUTE(Business & “\n” & ((IF({BusAdd1} = “”, “”,{BusAdd1} & “\n”) & IF({BusAdd2} = “”, “”,{BusAdd2} & “\n”)) & IF({BusAdd3} = “”, “”,{BusAdd3} & “\n”)) & BusPostCode, “”", “”)

Andrew_Enright
9 - Sun
9 - Sun

Agreed, SUBSTITUTE([Formula here], “”", “”) doesn’t work to omit these wrapping quotes upon paste outside or Airtable… For now we will have to strip them out in InDesign.

Does anyone know if there is an option for soft returns? It’s my presumption that \n is the equivalent of char(13). Is there an equivalent of char(10)? We’d ideally employ BOTH hard and soft returns, for reason of Style Sheets on the InDesign side.

W_Vann_Hall
13 - Mars
13 - Mars

newline'\n'is char(10), aka linefeed or LF. Unix and other Multics-ish systems use only a single-character indicator for end-of-line. (LF was chosen over the seemingly more-intuitive char(13), carriage return, because that character was typically used to create bold face and underscore [which Markdown doesn’ support] effects on then-standard line printers by printing a line, returning to the start of the line without advancing to the next line, and overprinting or underscoring text as needed.¹)

The CR/LF two-character sequence was a common microcomputer conceit — including, of course, for IBM-compatible PCs.

At one point I fooled around with some other escaped character sequences in Airtable — including '\r', the coding for carriage return — as well as some escaped numeric encodings, and, IIRC, the only one it seemed to recognize was '\n'.

Wikipedia has a nicely concise overview of the whole newline conundrum which still manages to include multiples of the amount of information one would likely care to know.


  1. One of the word processors that shipped with my first PC, a Columbia MPC-1600, had no support for font effects. Until I learned how to hand-embed Okidata printer control codes into my document text, I used the CR-but-no-LF trick for boldface and underscore — which was, believe it or not, as the users guide directed.
Jeri_Vespoli
6 - Interface Innovator
6 - Interface Innovator

This should not be a workaround, Airtable tech! Include an operator for line breaks - needed for web embeds as well, shouldn’t have to copy/paste and manipulate data from a relational database.

Kathy_Benson
6 - Interface Innovator
6 - Interface Innovator

I would like to vote for this feature to be added (i.e., to have newlines appear in grid view). I have some “reports” I have created that are based on grid views because grid views are easy to implement. When a master / detail relationship is designed, it only makes sense to start the next detail record on a new line.

W_Vann_Hall
13 - Mars
13 - Mars

This applies only to newlines created by formulas or entered in long text fields.

You can see this in my scheduling framework base in Airtable Universe. Take a look at the <Tasks> view in the [Templates] table: Set the row height to ‘Extra tall’ and examine the field called {‾‾‾‾‾‾‾‾‾‾}.

Eric_Petersen
7 - App Architect
7 - App Architect

I am thinking this issue has been somewhat resolved, but I am probably not understanding the use case.

I am consolidating a couple long text fields and date stamping them in the formula below. I rollup this field in another table with concatenate(values). It presents well in Airtable with the extra lines for easy reading. I am not running into the extra " issues mentioned above.

I do not have this use case, but I read about it above -> Word ignores the line breaks.
Pasting into Notepad works well. If I paste into Notepad first then Word, it works well too.

IF(AND(Notes,{Internal Note}), DATETIME_FORMAT({Create Date Florida Time},‘llll’)&"-"& Contact &"- (Internal)- “&{Internal Note}&” (External)- “& Notes & “\n\n”,
IF(Notes,DATETIME_FORMAT({Create Date Florida Time},‘llll’)&”-"& Contact &" (External)- “& Notes & “\n\n”,
IF({Internal Note}, DATETIME_FORMAT({Create Date Florida Time},‘llll’)&”-"& Contact &"- (Internal)- "&{Internal Note} & “\n\n”, BLANK())))