Automation
Free Apex code: automatically split addresses in Salesforce
Take an address like "Oak Street 9A" and automatically extract the street, house number and suffix. Useful in Flows, in integrations and when cleaning up address data.
- Reading time
- 2 min
- Published
- Updated
What the Apex action does for you
- Always clean address fields: Automatically separate street, number and suffix.
- Works in Flow: An Invocable Action you can use in an after-save Flow, a Screen Flow or an autolaunched Flow.
- Suitable for multiple objects: Account, Contact, Lead or Contract.
Download the complete ZIP
You'll receive the class, test class, README and license by email. The email is sent automatically.
How does this Apex action work?
- Flow sends a complete address to the action
- The action splits the address into street, number and suffix
- Flow uses these 3 values directly in your logic
- You can reuse the same action in other Flows
| Input | Street | No. | Suffix |
|---|---|---|---|
| Kerkstraat 12A | Kerkstraat | 12 | A |
| Dorpsplein 7-1 | Dorpsplein | 7 | 1 |
The start of the Apex code
@InvocableMethod(label='Address | Split Street into Components')
public static List<Result> run(List<Input> inputs) { /* ... */ }You'll receive the full class, with test class and README, by email. If you'd rather have the action built into your Flows, that is part of process automation in Salesforce.
Who is this for?
- Admins who automate processes with Salesforce Flow
- Consultants working with address validation
- Teams that connect Salesforce to external systems, such as a credit check or postal code API
Need custom development for your Salesforce environment?
We develop Apex solutions that fit your processes, tested and with documentation included.
Schedule a development session