Skip to content

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
All articles

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?

  1. Flow sends a complete address to the action
  2. The action splits the address into street, number and suffix
  3. Flow uses these 3 values directly in your logic
  4. You can reuse the same action in other Flows
InputStreetNo.Suffix
Kerkstraat 12AKerkstraat12A
Dorpsplein 7-1Dorpsplein71

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?

Need custom development for your Salesforce environment?

We develop Apex solutions that fit your processes, tested and with documentation included.

Schedule a development session