Leveraging Twilio API to validate and clean up mobile numbers in Salesforce CRM

Background

Founded in 1974, Second Harvest of Silicon Valley is one of the largest food banks in the nation, providing food to more than a quarter of a million people in Santa Clara and San Mateo counties every month.

Second Harvest of Silicon Valley uses Mogli for texting out of Salesforce. Mogli is a texting app built on Twilio that offers one-to-one messaging, surveys, and WhatsApp integration. Twilio is a platform that provides programmable communication tools for making and receiving phone calls, and sending and receiving text messages.

Problem 

When using a texting app, U.S. carriers require message originators (you or your customers) to keep subscriber lists clean by removing deactivated phone numbers from your lists. Recently, Twilio launched the Deactivations API, allowing customers to automate the process of downloading and cleaning deactivated subscribers from their lists. The reason to do this is two fold:

  1. Prevent Telephone Consumer Protection Act (TCPA) violations and ensure the SMS Campaigns are compliant by removing phone numbers that no longer belong to the person who signed up for the service.
  2. Lower the costs by minimizing messages sent to inactive numbers.

Additionally, Second Harvest of Silicon Valley wanted to ensure they have fewer errors when texting clients, by validating that the mobile numbers provided are actual mobile numbers. This required excluding numbers that are landlines, cannot be reached via text or are simply bad numbers. 

In absence of Mogli providing this functionality out of the box, the client reached out to DaizyLogik to design a solution that could be leveraged to accomplish this and would fit with Second Harvest’s business needs.

Full Sweep and Ongoing Maintenance

DaizyLogik worked with Second Harvest of Silicon Valley to craft a solution that would allow a full sweep of the mobile numbers in the Salesforce database paired with a “verify as you go” solution that keeps the data clean as new records are created, or information is obtained about Deactivated numbers.

For an initial validation of all existing mobile numbers in the Salesforce database, DaizyLogik implemented an off-platform Python script that ran an export of all mobile numbers in the database through the Twilio verification API. This ensured a fast verification process, free of Salesforce governor limits on a high volume of data. Additionally, DaziyLogik developed Apex and Flow automation to validate numbers in real-time as they are added to the system. To make sure nothing slips through, an additional nightly job looks for mobile numbers that have not been verified and makes sure they get validated at off peak hours.

In addition, by leveraging Apex, DaizyLogik assembled a solution to download the Deactivated number logs from Twilio, process them and update records accordingly in Salesforce.

Conclusion

The solution that DaizyLogik designed and implemented allowed Second Harvest of Silicon Valley to meet their goals in terms of data hygiene, maintain TCPA compliance and save money by having confidence that they are texting verified mobile numbers that are less likely to result in an error.

Want to learn more? Contact DaizyLogik to learn more about how we can support you with specialized consulting and custom development and help you get the most out of Salesforce.

Which flow would that be?

If you’ve ever run into or received this error message from Salesforce you know how frustrating it can be to not know right away which flow this is referring to.

The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301A0000000TizV. Flow error messages: <b>An unhandled fault has occurred in this flow</b>An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.

 

Here is one way to find out which flow this is referring to. Open the Developer Console and navigate to Query Editor. Type the following query, plugging in the id from the error message:

select masterlabel from flow where id = '301A..........V'

Make sure you check the “Use Tooling API” checkbox at the left bottom of the screen. Click Execute. This will return the label for the flow or process builder. Voila!

HomeKeeper 2.0 – Building the Future of HUD Reporting in Salesforce

Grounded Solutions Network worked with DaizyLogik, SoPact, and an advisory committee of users to help develop HomeKeeper into a HUD compliant CMS. As a sector-wide program management and impact measurement tool, HomeKeeper was well positioned to build on their popular app by expanding the housing counseling features and seeking approval from the US Department of Housing and Urban Development. Once made publicly available, HomeKeeper will be an excellent tool for affordable homeownership programs that offer workshops and other housing counseling services.

Read the full Case Study.

Should I use Process Builder or write Apex code?

If you have asked yourself this question recently here are some tips that can help you decide which path you should take. Imagine you have to implement the following scenario:

Use Case:  Users are signing up online and filling out a form. They have to provide contact information for 4 additional Contacts at their organizations. For each additional Contact they will enter a First Name, Last Name, Email, Phone and Role. All this information will be automatically fed to Salesforce in the form of an online subscription record.

For each additional Contact you are required to first determine if it exists in Salesforce and if not then create it. If you find the contact in Salesforce (based on Last Name and Email) then you have to update the Phone, set the mailing address and create an Affiliation to the Account/Organization with the specified role.

(Please note that this use case uses Affiliations which are a custom object specific to the SF Non Profit Starter Pack. An Affiliation is a junction object between a Contact and an Account.)

The PROCESS BUILDER AND FLOW ROUTE

It is possible to go the process builder route for this one.