Table of Contents
Formatting International Numbers
HubSpot-Programmable-Automations/format_international_numbers.py at main · abdulrahimpds/HubSpot-Programmable-Automations
Problem Statement
It is not possible to have international phone numbers natively structured in HubSpot.
So, we may run into problems where we have many international contacts with missing dial codes, so it is difficult to recognize from which country that contact number is.
Then we have to dig into details for more information about that contact which can be time-consuming.
Method and Solution
I was learning OpsHub, so I took inspiration from here; where the problem was solved in Node.JS and I experimented with the same methodology in Python as I learn and work in Python.
- I pulled the dial codes from a website and cleaned and structured the data for preprocessing.
- Created a function for converting phone numbers and mobile numbers into an international number:
dial code + phone/mobile number
- Then I created a logic for filtering international numbers with or without dial codes.
- If the contact number does not have a dial code, it is converted to a number with a dial code and then pushed to CRM.
- Otherwise, we directly push the contact to CRM.
Process Flow Schema
.png)
Final Result
We then have updated contact number properties with the dial codes.
Concatenate Address Properties
HubSpot-Programmable-Automations/concatenate-address-properties.py at main · abdulrahimpds/HubSpot-Programmable-Automations