Didn't know.. can text break inside the quotes with (no quotes needed around /n)

Pretty quiet in this forum. Is this board going to survive? I put lots of notes here so I better make a copy in case this is going shut down.

I don’t know if it’s just me but I didn’t know I can put \n inside the text within quotes.

I don’t think it was initially possible as this page here still shows each line of text must be separated by quotes followed by \n in quotes.

I just noticed I can “write this text like this and put here /nseparator and the word separator will be on the next line”.

So I don’t need to “write this text like this and put here”&“/n”&“separator to get the word separator on the next line”.

So just mention in in case anybody noticed.

1 Like

For others who may stumble on this post, I added bolding to show that your slash/backslash is pointed in the wrong direction the last two times. \n is correct.

Also, you don’t explicitly state that you are talking about formula fields, so I’ll drop that word in this post for better searchability.

Finally, I personally think that the formula on this support page (and formulas on other support pages) as not written by someone who has thought about writing style for code. I would re-write that particular formula like this:

CONCATENATE(
  "Job Title: " & {Role} & "\n",
  "Department: " & {Department} & "\n",
  "Number of years experience required: " & {Experience Required}
& "\n",
  "\n",
  "Job Description: " & "\n",
  {Description}
)

When I have to write a formula that will produce paragraphs of text, I use this style. I find it easier to read and maintain when the line breaks occur at the ends of lines of code.

CONCATENATE(
  "write this text like this and put here \n",
  "separator and the word separator will be on the next line"

But there are many different ways to do things in code, and different reasons for each approach. I probably think about coding style for Airtable formulas more than most people. Use what works for you (and your future self)!

1 Like