function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Natasha AliNatasha Ali 

Splitting of Address field into Address 1 & 2, City & Postcode for API connection

Hi,

So we will be using an API to connect Salesforce to a third party app and one of the fields shared is Address. In Salesforce, the address is already concatenated (it comes in through a separate web app as Address Line, Address Line 2, City and Postcode). However the third party we want to connect to requires the Address field to be split. Is there some apex or mechnanism that would split the fields? Or anything that needs to be written into the API connections to enable this?

Any help is much appreciated :)
Many Thanks,
Natasha 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Natasha,

Greetings to you!

Please refer to the below links which might help you further with the above requirement.

https://developer.salesforce.com/forums/?id=9060G000000BiE9QAK

https://success.salesforce.com/answers?id=90630000000DNcNAAW

https://salesforce.stackexchange.com/questions/241617/split-address-field-into-separate-fields-based-on-line-break

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Lokesh KumarLokesh Kumar
Are you connecting the standard account object? If yes, There are already these fields available as Billing City, Billing Country and so on.
Natasha AliNatasha Ali
Hi Lokesh,
The accounts are person accounts so I can't find those fields.

Many Thanks,
Natasha 
Nick SFDCNick SFDC
You can login to workbench and go to Standard & Custom Objects > Account > click on fields
There you can find the BillingAddress fields API individually like BillingStreet, BillingCity, BillingCountry...