On contact, I have two property Country and Country Code.
I need to auto-update Country Code based on Country whenever a new contact is created.
I know I can use the workflow, but it is only useful if I have 4-5 countries. But if I have more than 100 countries, then it will become tough to handle that workflow.
is there any way where I don’t need to hard code each and every country in my workflow. Like store the country and country code in list and in run time get the value from there.
Hey @narendra1adhika
This looks like something where I would use a webhook that subscribes to contact creation.
An event would be sent to your app that would then would check the country and then send a patch back to HubSpot and update your contact accordingly.
But, doing this would require you to build an app and set up the process which might be just as much work as your proposed workflow.
@Bryantworks , @Kevin-C let me know if I totally overcomplicated this 
Hey @narendra1adhika and thanks @dennisedson
Because this is on contact creation it could be done by populating a hidden form field via JS based on the selected value.
@Kevin-C Where will be that JS?
Hey @narendra1adhika
This is a very rough example. It will need some work to ensure you’ve got all of you test cases covered. Hope it helps!
Hey @narendra1adhika,
As far as I know, with HubSpot’s current phone number formatting feature, you still have to manually select the country code. So, you’d have to find some workaround to get the country code to auto-populate.
I think that Insycle could be of help here. Full disclosure, I work for Insycle, but it seems a good fit for your use case:
- Format your phone number field with a country code, based on location data.
- Autopopulate a “country code” field based on location data.
- Format phone numbers using many pre-built templates for popular formats.
- Build custom phone number formatting templates.
Hope that helps!
Best,
Ryan