Creating / formatting address

Hi there

We have a PostgreSQL database synchronised. For a specific table, address data is imported as text in different columns - i.e. Address Line 1, Address Line 2 etc.

Is there a way to transpose this into the ‘Street Address’ column in Noloco?

If not, is there a way to concatenate this display into a friendly display format (e.g. using Formulas), but where lines are only included if data exists. For example, Address Line 2 is an optional field - if we bring the data together we want to avoid blank lines and unnecessary separators where Address Line 2 is not supplied.

Hey @aferguson024 :wave: Great question, and welcome to the community!

There’s no way to transpose different fields into one address field, however it would be possible to combine them using a formula.

Checkout the examples we have in our Formula Guides

This example formats a full name with a space between first name and last name, if either first name or last name are not empty.

{first name} & 
IF(
 OR(
  ISBLANK({first name}),
  ISBLANK({last name})
 ),
 "",
 " "
) & 
{last name}

You could do something very similar with newlines for an address. To add a line, you just need to press enter on the keyboard so it would look something like this.

{line 1} &
ISEMPTY({line 1}, "", "
")

See how the last set of quotes enclose a newline

1 Like

Thanks for this, but not quite getting there.

I’ve tried the following:

Add Line 1

& ISBLANK(
Add Line 2

, ", ", “”)
&
Add Line 2

&
ISBLANK(
Town

, ", ", “”)
&
Town

&
ISBLANK(
County

, ", ", “”)
&
County

& ISBLANK(
Postcode

, ", ", “”)
&
Postcode

Field names are entered correctly within Noloco (used the selector), but the output I get is:

2 Kingsley RoadTRUEFALSEFrodshamFALSECheshireFALSEWA6 6AP

I also tried ISEMPTY and the formula didn’t work at all.

FYI I don’t think ISBLANK or ISEMPTY are documented in your Help Guide, I can see the name example but not explanation of the function / arguments.

You need to wrap your ISBLANK in an IF what’s happening now is that your ISBLANK is outputting TRUE or FALSE so you need to wrap that in an

IF(ISBLANK({value), "", "
")
1 Like

That’s worked, thank you!