Merging Multiple Address lines into one formatted long text


#1

I imagine this is pretty common, but haven’t figured this one out yet as I’m struggling a bit with understanding exactly how the CONCATENATE feature works.

I have a flow that regularly exports data from an accounting application into Airtable. The info always exports fields seperately as:

  • Ship Line 1
  • Ship Line 2
  • Ship Line 3
  • Ship Line 4
  • City
  • State
  • Postal Code
  • Country

I want to combine it into something a bit easier to display on the page designer. I’d like it to look very similar to how a long text would look where I can insert line breaks, and in the event Ship Line 3 and 4 are not present, omit them to eliminate unnecessary spacing.

Desired look:

Ship Line 1
Ship Line 2
Ship Line 3 (if present), Ship Line 4 (if present)
City, State ZIP Country

Any ideas?


#2

You’re in luck: In the Page Designer Block, newline characters ('\n') are read as a CR/LF (or <br>) equivalent, which makes assembling this a snap:

{Ship Line 1}&'\n'&
{Ship Line 2}&'\n'&
IF(
    {Ship Line 3}!='',
    {Ship Line 3}&'\n',
    ''
    )&
IF(
    {Ship Line 4}!='',
    {Ship Line 4}&'\n',
    ''
    )&
{City}&', '&
{State}&' '&
{Postal Code}&' '&
{Country}

To make things prettier and easier to read, you might want to substitute wider fixed spaces between, say, {State} and {Postal Code} or {Postal Code} and {Country}. Personally, I prefer an en space (U+2002) for the first and an em space (U+2003) for the latter:

Bigcityname, ST PCODE Country
Bigcityname, ST PCODE Country

edit: except I can’t demonstrate what that would look like because the forum software, upon save, rewrites en and em spaces into normal space characters. Oh, wait — let me do it this way:

CityStateCountrySpacing


#3

Awesome! This worked well. Thanks Vann. Does anyone know if page designer can do multiple pages if theres too much information?


#4

How can this work inside a table (not in Blocks)?


#5

In grid view, Airtable will break at a newline character if rowheight is set to something other than ‘short.’ As I recall, a row height of ‘extra tall’ will display up to six lines — but don’t quote me.

Note this works for both single-line and long text fields.

In gallery and kanban views, Airtable will display the first four lines of a long text field. Since text fields resulting from a formula are assumed to be single-line, you can’t take advantage of these routines unless you copy the resulting value and paste it into a long text field. If you choose to go that route, you can perform that copy/paste manually or through such middleware as Zapier or Integromat. The [Documentation] table in my Wardrobe Manager base contains a guide showing step-by-step instructions for defining a Zap to copy from a single-line to a long text field. This is considered a two-step Zap and can be run from a free Zapier account. (It should be possible to do the same thing with Integromat — presumably with a higher per-month transaction budget, as well — but I’ve not yet defined and published such a solution.)

@Scott_Lusignan No doubt you’ve discovered this already, but for those reading over your shoulder, the last I checked, the Page Designer Block did not support dynamically increasing text areas allowing it to spill over to additional pages. I’ve not attempted this myself, but @Filipa_Didier reports one can ‘body-check’ the Block into delivering multi-page reports by choosing a custom page size and setting it for multiples of the full-page height. No doubt it also requires painstaking tweaking of the Block layout and one’s printer to ensure print elements don’t overlap pages edges and the like — but if we weren’t up for a challenge, we’d all be using Filemaker, right?¹


  1. For those without Filemaker experience: Obviously a joke.