+ Start a Discussion
Laura Boyd 25Laura Boyd 25 

Split of Street Address fields

Hi,

Our street address field in Salesforce mormally contains three seperate lines, to be able to support a third party integration I need to split these into seperate fields

For reference the information stored in the street field on this example account is:

123 Test Street
Test Town
Test County

Using the below formulas (found on a very helpful blog) I have sucesfully split the address into seperate fields. My issue is that with the TestAddress2 formula I want it only display up to the end of "Test Town" rather than displaying all of the remaining street value

Any help would be appreciated?

User-added image
 

TestAddress1 Formula:

IF( 
CONTAINS(BillingStreet , MID($Label.AdDepotAddressSplit,3,1)), 
LEFT( 
BillingStreet, 
FIND(MID($Label.AdDepotAddressSplit,3,1), BillingStreet) 
), 
BillingStreet 
)

TestAddress2 Formula:
 
IF( 
CONTAINS(BillingStreet, MID($Label.AdDepotAddressSplit,3,1)), 
RIGHT( 
BillingStreet, 
LEN(BillingStreet)-LEN(TestAddress1__c)), 
"" 
)

 
Alain CabonAlain Cabon
Hi,

You can split TestAddress2 at the line breaks and keep one line (here the first line).

The Edgar Zamora's trick works fine:  https://success.salesforce.com/answers?id=90630000000DNcNAAW

1) Custom Label : line_break : "-" (new line) "-"
User-added image

2) streetonly : formula which uses $Label.line_break
SUBSTITUTE( BillingStreet ,SUBSTITUTE($Label.line_break, "-", ""),"<BR>")
3) streetonly2 : formula which uses streetonly 
IF(CONTAINS( streetonly__c , '<BR>'), LEFT(streetonly__c, FIND('<BR>', streetonly__c )-1), streetonly__c )

User-added image

Regards