I currently have a form that requires users to enter their phone number and other details. Once the form is submitted a contact gets created on Hubspot with the details from the form. A lot of times Contacts are also created Manually or through some other means.
My question is I have a ‘Country of Residence’ field for each contact. How can this be auto populated by using a contact’s phone number ?Is there a way to automate this by looking at the country code?
Hi @KSingh42 ,
If you have Operations Hub, this can be done through a coded action where you create a simple script that maps the country code of a number to the country. If you do not have Operations Hub, you could create a small NodeJS app that listens to a Private App webhook using the same script that you would use in a coded action.
An alternative approach is creating a front-end script that listens to changes to the phone number field in your form and stores the country in a hidden field in your form.
This would require a custom mapping and probably the usage of a library like: https://www.npmjs.com/package/libphonenumber-js
But yes, there are quite a few ways you can achieve this.
@Teun I’m not quite familiar with the coded action part and I’m also not well versed with coding in general. Can you help me out with how the script is going to be and what code to put?
Hi @KSingh42 ,
I would advise to search for a freelance HubSpot developer who can code this for you. This might require a bit of testing and debugging, so it’s not like I can give you a ready-to-use script.
I was able to accomplish this using Make.com and OpenAI. I did a bulk load with 20k contacts and then activated a watch scenaario that monitored all new clients and will add their country as they are added if they have a phone number.