Keeping addresses in sync is a crucial part of account management. Most of the time, the billing address and shipping address are the same when working in the B2C industry.

Salesforce does provide an out-of-the-box way to copy the Billing address to the mailing address in the Classic interface. Unfortunately, such a feature doesn’t exist in the lightning experience.

In this article, we will use Salesforce Flow to achieve it. This concept can be applied to copying addresses from Account to Contact.

Let’s start with a real-time use case.

Use Case

Sara William is working as a system administrator in the Appiuss Software. She has to implement the option for users to choose the billing address as the shipping address for accounts.

Billing and shipping addresses are often the same – but not always.

Let’s spend a few minutes going through the below process flow diagram to understand it at a high level before we proceed to the solution.

 

 

Prerequisite

Make sure the Same as Billing Address checkbox field is created on the Account object.

 

Solution

  1. Click on Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows then click on the New Flow.
  4. Select the Record-Triggered Flow option, click on Create and configure the flow as follows:
    1. Object: Account
    2. Trigger the Flow When: A record is created or updated
    3. Set Entry Criteria, Conditions requirements: None
    4. Optimize the Flow for: Fast Field Updates
  1. Click Done.
  1. On the flow designer, click on the +icon and select the decision element.
  2. Enter the Label and the API Name will auto-populate.
  3. Under Outcome Details, enter the Label the API Name will auto-populate.
  4. Add Condition Requirements to Execute Outcome as Custom Condition Logic Is Met.
  5. Condition Logic = 1 AND (2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8)
    1. {!$Record.Same_as_Billing_Address__c} Equals True
    2. {!$Record.BillingCity} Is Changed True
    3. {!$Record.BillingCountry} Is Changed True
    4. {!$Record.BillingPostalCode} Is Changed True
    5. {!$Record.BillingState} Is Changed True
    6. {!$Record.BillingStreet} Is Changed True
    7. {!$Record.Id} Is Null True
    8. {!$Record.Same_as_Billing_Address__c} Is Changed True
  1. To assign Billing Address to Shipping Address, drag and drop the Assignment element under Yes node onto the flow designer and follow the below:
    1. {!$Record.ShippingCity} Equals {!$Record.BillingCity}
    2. {!$Record.ShippingCountry} Equals {!$Record.BillingCountry}
    3. {!$Record.ShippingPostalCode} Equals {!$Record.BillingPostalCode}
    4. {!$Record.ShippingState} Equals {!$Record.BillingState}
    5. {!$Record.ShippingStreet} Equals {!$Record.BillingStreet}
    6. Click Done.

 

  1. Save the flow and your flow looks like the below.

 

Don’t forget to Active the flow.

Now onwards if the Same as Billing Address field is checked, Billing Address will automatically copy to the Shipping Address.

 

You are Done!!!

I would love to hear about your experience in automating the process of copying one field value to the other field by using the record-triggered flow. How do you use it?

Join our newsletter.

No spam, just learning!

Continue Reading

Get a free consultation.

Call us today at (469) 790-0063

Schedule a Consultation

5 Comments

  1. Melanie April 10, 2022 at 8:07 am - Reply

    This is what i was looking for.

  2. ferdinand212 June 3, 2022 at 6:29 am - Reply

    ThIs is exactly what i needed, thanks a bunch

  3. Nancy June 14, 2022 at 2:25 pm - Reply

    Fun! Took me a few tries (to go back and read more carefully, really) but it works! My users will be so happy.

Leave a Reply