Skip to main content
Best answer

Find a phone number's matching country code in Sheets and update Salesforce

  • July 8, 2021
  • 1 reply
  • 1872 views

Hi, 

I have tried but to no success to make the following flow. where when a lead is created in SF and has a phone number but an empty country field. I would like to have this populated. So it would work in the way that:

Lead created in salesforce - has a phone number such as +44 and country field is blank - zap triggered - searches  a google sheet and finds data of country code and country - populates field in salesforce.

Best answer by GetUWiredBest answer by GetUWired

Hi @Wiesiek281190 

You will need to make sure your sheets lookup column will be an exact match. 

 

so one column would be the codes and the adjacent would be the corresponding country. 
 

Codes Country
+1 United States
+44 United Kingdom

 
For Zapier to work well, the phone number should always be formatted the same way so that you can easily parse out the country code. As an example, lets say you have phone numbers but the country code is always separated by a space. +1 123-456-7890 or +44 2344568792. If the country codes are not separated from the phone number in a consistent way, this will be hard to build as country codes are not all the same length. I.e if the phone number’s are like +441234567890. or +299111111 it would be hard to know that in the first one the code is +44 but in the second it should be +299. 

 

With that, in Zapier, I would set up a zap similar to this:

Trigger: New Lead

Step 2: Filter to only let through leads that meet your criteria. Phone number exists, country doesn’t

Step 3: Formatter Split Text to split out the country code

Step 4: Lookup Spreadsheet Row in Google Sheets

Step 5: Update Lead Record
 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • Answer
  • July 8, 2021

Hi @Wiesiek281190 

You will need to make sure your sheets lookup column will be an exact match. 

 

so one column would be the codes and the adjacent would be the corresponding country. 
 

Codes Country
+1 United States
+44 United Kingdom

 
For Zapier to work well, the phone number should always be formatted the same way so that you can easily parse out the country code. As an example, lets say you have phone numbers but the country code is always separated by a space. +1 123-456-7890 or +44 2344568792. If the country codes are not separated from the phone number in a consistent way, this will be hard to build as country codes are not all the same length. I.e if the phone number’s are like +441234567890. or +299111111 it would be hard to know that in the first one the code is +44 but in the second it should be +299. 

 

With that, in Zapier, I would set up a zap similar to this:

Trigger: New Lead

Step 2: Filter to only let through leads that meet your criteria. Phone number exists, country doesn’t

Step 3: Formatter Split Text to split out the country code

Step 4: Lookup Spreadsheet Row in Google Sheets

Step 5: Update Lead Record