Salesforce to Avochato Contact Sync using Flow builder

Use Salesforce Flow automation to update Avochato contacts based on Salesforce data

Avochato for Salesforce offers a robust data sync from Avochato to Salesforce, including contact data and any messaging or call activities.

But sometimes there are critical data points being updated on your Salesforce system that you would like to update within the Avochato contact:

  • In one use case, you may want to update the Avochato Contact’s Owner to mirror the Salesforce’s Contact/Lead’s owner when it was just changed in Salesforce.
  • Another use case would be to associate a specific Salesforce record with an Avochato Contact via the phone number, when you have multiple potential matches from Salesforce, but want to prescriptively associate the main Salesforce record with that Avochato Contact’s phone.

Below is a step by step guide to creating a Flow in Salesforce to leverage the “Avochato - Update Contact” action to update the Avochato’s Contact and Conversation owner based on a change to the Salesforce record’s owner.

1. Confirm API Credentials are Active

In order to use any of the Avochato API actions within Flow builder (or List View Broadcasting or Apex Code), you need to have sent the Avochato API credentials to Salesforce, and confirm they’re saved properly in Salesforce. See this article on how to save, enable, and confirm your Avochato API credentials within Salesforce.

2. Create a Flow

We’ll show an example of manually assigning a Salesforce Contact’s Id and SObjectType (as well as Owner) to an Avochato Contact, using the phone number as the identifier to match the records.

Sample Use Case

Let’s describe the use case:

“Oh the Joy” is a tech company that sells an app geared towards elementary students to learn math and science in a fun, interactive way. They often sell different products within the app to multiple children within the same family, and hence, the same phone number can be associated with multiple people within the same family (since they’re signed up under their parent’s mobile phone number).

Oh the Joy uses Avochato for Salesforce to communicate with parents, and they want to assign the parent’s Salesforce Contact Id and Type to the Avochato Contact, so that messaging activity syncs to the parent’s Salesforce Contact record, rather than the Avochato contact accidentally assigning itself to one of the children’s Salesforce records.

Oh the Joy usually uses the Phone field on Contacts to populate a phone number. They will fill in the MobilePhone field when it’s the official Salesforce record that they want to associate with the Avochato Contact that matches the same phone number.

Let’s use a Salesforce Record-Triggered Flow to listen for any changes to Contact.MobilePhone and use the Avochato action to update the Avochato Contact’s Salesforce ID and Type.

Contact Record-Triggered flow, step by step

  1. Go to Salesforce’s Setup → Flows.
    1. Notion image
  1. Click the “New Flow” button in the upper right corner to create a new Flow.
    1. Notion image
      👍
      You can also modify an existing Flow and add the Avochato action node into that automation, but for our example, we’ll stick to creating a new Flow
  1. Create a Contact Record-Triggered Flow
    1. Notion image
    2. For Select Object, type in and choose “Contact”, and select the “A record is updated” radio button option for when to trigger the Flow.
      1. Notion image
      2. For Entry conditions, set the Condition Requirements to “All Conditions Are Met (AND)”, and set
        1. The field to MobilePhone, operator “Is Changed” and Value to “$GlobalConstant.True”
        2. The next field to MobilePhone, operator “Is Null”, and Value to False, so that we ensure there’s indeed a phone number value within the MobilePhone
        3. Notion image
    3. “When to Run the Flow for Updated Records” will automatically be set to “Every time”, and we want to Optimize the Flow for “Actions and Related Records”
      1. Make sure to mark the checkbox to Include a Run Asynchronously path, as the Avochato action is a callout to an external system
      2. Notion image
  1. Now you will see an empty Flow, with paths to Run Immediately and Run Asynchronously. Click on the “Plus” button icon within the Run Asynchronously path
    1. Notion image
  1. Within Add Element, start typing in “Avochato” into the search bar, and select the “Avocahto - Update Contact” action
Notion image
  1. For this New Action, start filling in the Label and Description, like:
    1. Label: “Update Avochato Contact”
    2. API Name: “Update_Avochato_Contact”
    3. Description: Update the Avochato Contact's Salesforce Record ID and Type, as well as the Owner
  1. Within the Input Values section, start filling in the following attributes:
    1. phone: {!$Record.MobilePhone}
      1. This phone attribute is the main field to populate, which will be used a the unique identifier to match the Avochato Contact.
    2. salesforce_object_id: {!$Record.Id}
    3. salesforce_object_type: Contact
      1. These two fields will ensure the Avochato Contact is linked to this triggering Salesforce Contact Record, and any activity and data changes will sync properly to this Salesforce record
      2. Notion image
    4. (Optional) tags: <some useful tag>
      1. Notion image
      2. Setting a tag (or tags that are comma separated) is a great way to set Avochato Tags on the Avochato Contact, so that you can see when a particular Avochato Contact was updated by Salesforce flow automation
        1. A sample value here could be flow-sfdc-id-updated
    5. (Optional) subdomain: <your Avochato Inbox of choice>
      1. Notion image
      2. If you have multiple Avochato Inboxes / Accounts, type in the subdomain of the inbox where the Avochato Contact lives. For example, you may have an inboxohthejoy and ohthejoy_support as a separate dedicated Avochato line for support inquires. Populate this subdomain if you want to specifically update an Avochato Contact within that specific Inbox
        1. ⚠️
          If you have multiple inboxes, the Avochato user whom you generated the Avochato API credentials for that synced to Salesforce, must be an active Avochato user in each inbox in order for the API callouts to work. If that Avochato User is only part of the ohthejoy inbox, then trying to update an Avochato Contact within the ohthejoy_support inbox will fail
  1. Click Done to save the Avochato action
    1. Notion image
  1. Click “Save” in the upper right corner of the page, and give the Flow some useful Label and Description:
    1. Flow Label: Contact API Actions Automation
    2. Flow API Name: Contact_API_Actions_Automation
    3. Description: When MobilePhone is updated, update the matching Avochato Contact's Salesforce record ID and type
  1. Click “Save”, then click on “Activate” to enable the automation
    1. Notion image
  1. Done!

3. Test and confirm

  1. Go into the existing Salesforce Contact record of choice, and update the Mobile Phone number (if it already exists, just delete it, save the record, re-edit and put the same phone number back in).
  1. Save the new updated Mobile Phone.
    1. Notion image
  1. Within Avochato, search for the Avochato Contact/conversation by that same phone number.
    1. Notion image
      • When you click into the Avochato Contact/conversation, you’ll see the Avochato Tag was added from Flow builder, which confirms that Salesforce successfully updated the Avochato Contact information
Did this answer your question?
😞
😐
🤩