Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Extra Lines from Formula using TRIM() and & "\n" &

Topic Labels: Formulas
Solved
Jump to Solution
876 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Scott_Brasted
7 - App Architect
7 - App Architect

I have addresses with several fields, some fields are not always necessary.

  • Member
  • Organization
  • Mail Address
  • 2nd Mail Address
  • City
  • State
  • Zipo Code

Trying to get a multi line field that has no blank lines.

Here's the formula I am using. I cannot find a way to get rid of the blank lines. What am I doing wrong?

I also included a screen shot of the existing multiline field.

Thanks in advance for any help, Scott

Screenshot 2024-03-19 at 10.22.54 AM.png

 

TRIM(
IF(
  AND(
      Organization,
      {2nd Mail Address}
      ),
      Member & "\n" & Organization & "\n" & {Mail Address} & "\n" & {2nd Mail Address} & "\n" & City & ", " & State & " " & {Zip Code},
IF(
  AND(
      Organization,
      {2nd Mail Address} = BLANK()
      ),
      Member & "\n" & Organization & "\n" & {Mail Address} & "\n" & City & ", " & State & " " & {Zip Code},
IF(
  Organization = BLANK(),
  Member & "\n" & {Mail Address} & "\n" & {2nd Mail Address} & "\n" & City & ", " & State & " " & {Zip Code},
IF(
  AND(
      Organization = BLANK(),
      {2nd Mail Address} = BLANK()
      ),
      Member & "\n" & {Mail Address} & "\n" & City & ", " & State & " " & {Zip Code}
)))))

 

1 Solution

Accepted Solutions
pressGO_design
10 - Mercury
10 - Mercury

Instead of trying to address every permutation of data, you can create IF statements for each option with the “/n”+field when it’s true. Everyone has a name, a city, state, and zip code, so 

Trim(
Member&
IF(Organization, “/n”&Organization)&
IF(mailAddress, “/n”&mailAddress)&
IF(2ndMailAddress, “/n”&2ndMailAddress)&
”/n”&City&”, “&State&” “&Zip
)

See Solution in Thread

2 Replies 2
pressGO_design
10 - Mercury
10 - Mercury

Instead of trying to address every permutation of data, you can create IF statements for each option with the “/n”+field when it’s true. Everyone has a name, a city, state, and zip code, so 

Trim(
Member&
IF(Organization, “/n”&Organization)&
IF(mailAddress, “/n”&mailAddress)&
IF(2ndMailAddress, “/n”&2ndMailAddress)&
”/n”&City&”, “&State&” “&Zip
)

Scott_Brasted
7 - App Architect
7 - App Architect

Wow, thank you pressGO_design. I sometimes get too literal and too verbose when writing formulas.  Really appreciate the help. I will store this away for the future too. Best, Scott