Question

Automatically Updating Territory based on Country List

  • 14 September 2021
  • 6 replies
  • 152 views

Badge +2

Hello, 

 

I was wondering if anyone has an elegant solution to automatically update a picklist field (territory) based on another free text field (country)

 

For Example. 

If Country = USA, United States, Canada 

Update Territory to North America 

 

I know I can do this via a workflow, but due to the number of countries and territories, it will become 8+ workflows. 

 

The Territory values i’m looking to automate are below. 

 

Cheers.

 

Northern Europe

Aland Islands, Denmark, Estonia, Faroe Islands, Finland, Guernsey, Iceland, Ireland, Isle of Man, Jersey, Latvia, Lithuania, Norway, Sark, Svalbard and Jan Mayen, Sweden, United Kingdom, UK, Scotland, Wales

 

Southern Europe

Albania, Andorra, Bosnia and Herzegovina, Croatia, Gibraltar, Greece, Italy, Republic of Macedonia, Macedonia, Malta, Montenegro, Portugal, San Marino, Serbia, Slovenia, Spain, Vatican City

 

Western Europe

Austria, Belgium, France, Germany, Liechtenstein, Luxembourg, Monaco, Netherlands, Switzerland

 

Eastern Europe

Belarus, Bulgaria, Czech Republic, Hungary, Poland, Moldova, Romania, Russia, Slovakia, Ukraine

 

North America

USA, US, United States, United States of America, Canada, Bermuda

 

South America

Colombia, Venezuela, Ecuador, Peru, Brazil, Argentina, Uruguay, Paraguay, Chile, Suriname, Bolivia, Guyana

 

Central America

El Salvador, Costa Rica, Belize, Guatemala, Honduras, Nicaragua, Panama

 

Middle East

Cyprus, Syria, Lebanon, Israel, the West Bank, Gaza, Jordan, Iraq, Iran, Saudi Arabia, Yemen, Oman, United Arab Emirates, Qatar, Bahrain, Kuwait,  Egypt, Libya.

 

Africa

Algeria, Angola, Benin, Botswana, Burkina Faso, Burundi, Cabo Verde, Cameroon, Central African Republic (CAR), Chad, Comoros, Congo, Democratic Republic of the Congo, Republic of the Cote d'Ivoire, Cote D’Ivoire, Djibout,

Egypt, Equatorial Guinea, Eritrea, Eswatini, Swaziland, Ethiopia, Gabon, Gambia, Ghana, Guinea, Guinea-Bissau, Kenya, Lesotho, Liberia, Libya, Madagascar, Malawi, Mali, Mauritania, Mauritius, Morocco, Mozambique, Namibia, Niger, Nigeria, Rwanda, Sao Tome and Principe, Senegal, Seychelles, Sierra Leone, Somalia, South Africa, South Sudan, Sudan, Tanzania, Togo, Tunisia, Uganda, Zambia, Zimbabwe

 

Indian SubContinent

India, Pakistan, Bangladesh, Nepal, Sri Lanka, Bhutan, and the Maldives

 

Asia

Afghanistan, Armenia, Azerbaijan, Bhutan, Brunei, Cambodia, China, Cyprus, Georgia, Indonesia, Japan, Jordan, Kazakhstan, Kyrgyzstan, Laos, Lebanon, Malaysia, Maldives, Mongolia, Myanmar, Burma, Nepal, North Korea, Oman, Philippines, Russia, Singapore, South Korea, Taiwan, Tajikistan, Thailand, Timor-Leste, Turkey, Turkmenistan, Uzbekistan, Vietnam

 

Pacific Islands

Northern Mariana Islands, the Federated States of Micronesia, Fiji, French Polynesia, Kiribati, the Marshall Islands, Nauru, New Caledonia, New Zealand, Palau, Solomon Islands, Tonga, Tuvalu, Vanuatu, Wallis, Futuna

 

 


6 replies

Userlevel 5
Badge +9

Hello @Nickg,

 

Apologies for the delay in getting back here. You can definitely achieve your business requirements with the help of Freshdesk functionality, Automation, however, we understand your concern. In this case, you can make use of Freshdesk APIs to automatically update tickets based on certain conditions. You can further write custom scripts with the help of your developers to achieve the use case.

In case you require any help from us, feel free to drop a note here or write to support@freshdesk.com. :)

Hi @Nickg,

I would suggest to try Mapsly which includes territory management solution that directly integrates with Freshworks. Inside the tool you can create territories with certain regions that will include countries that you’ve mentioned and then save these territories back to Freshworks. It has a free 14-day trial, so I suggest to give a shot.

 

you can use workflows

1st you define Country field  all countries in a dropdown menu. Go to Admin/Accounts interface and define it

then setup territories

then in workflows say if country is 

India,

or

Pakistan,

or Bangladesh,

or

Nepal,

or

Sri Lanka, or

Bhutan, or

Maldives

 

then 

Territory is: Indian SubContinent

 

works for me

Hello, 

 

I was wondering if anyone has an elegant solution to automatically update a picklist field (territory) based on another free text field (country)

 

For Example. 

If Country = USA, United States, Canada 

Update Territory to North America 

 

I know I can do this via a workflow, but due to the number of countries and territories, it will become 8+ workflows. 

 

The Territory values i’m looking to automate are below. 

 

Cheers.

 

Northern Europe

Aland Islands, Denmark, Estonia, Faroe Islands, Finland, Guernsey, Iceland, Ireland, Isle of Man, Jersey, Latvia, Lithuania, Norway, Sark, Svalbard and Jan Mayen, Sweden, United Kingdom, UK, Scotland, Wales

 

Southern Europe

Albania, Andorra, Bosnia and Herzegovina, Croatia, Gibraltar, Greece, Italy, Republic of Macedonia, Macedonia, Malta, Montenegro, Portugal, San Marino, Serbia, Slovenia, Spain, Vatican City

 

Western Europe

Austria, Belgium, France, Germany, Liechtenstein, Luxembourg, Monaco, Netherlands, Switzerland

 

Eastern Europe

Belarus, Bulgaria, Czech Republic, Hungary, Poland, Moldova, Romania, Russia, Slovakia, Ukraine

 

North America

USA, US, United States, United States of America, Canada, Bermuda

 

South America

Colombia, Venezuela, Ecuador, Peru, Brazil, Argentina, Uruguay, Paraguay, Chile, Suriname, Bolivia, Guyana

 

Central America

El Salvador, Costa Rica, Belize, Guatemala, Honduras, Nicaragua, Panama

 

Middle East

Cyprus, Syria, Lebanon, Israel, the West Bank, Gaza, Jordan, Iraq, Iran, Saudi Arabia, Yemen, Oman, United Arab Emirates, Qatar, Bahrain, Kuwait,  Egypt, Libya.

 

Africa

Algeria, Angola, Benin, Botswana, Burkina Faso, Burundi, Cabo Verde, Cameroon, Central African Republic (CAR), Chad, Comoros, Congo, Democratic Republic of the Congo, Republic of the Cote d'Ivoire, Cote D’Ivoire, Djibout,

Egypt, Equatorial Guinea, Eritrea, Eswatini, Swaziland, Ethiopia, Gabon, Gambia, Ghana, Guinea, Guinea-Bissau, Kenya, Lesotho, Liberia, Libya, Madagascar, Malawi, Mali, Mauritania, Mauritius, Morocco, Mozambique, Namibia, Niger, Nigeria, Rwanda, Sao Tome and Principe, Senegal, Seychelles, Sierra Leone, Somalia, South Africa, South Sudan, Sudan, Tanzania, Togo, Tunisia, Uganda, Zambia, Zimbabwe

 

Indian SubContinent

India, Pakistan, Bangladesh, Nepal, Sri Lanka, Bhutan, and the Maldives

 

Asia

Afghanistan, Armenia, Azerbaijan, Bhutan, Brunei, Cambodia, China, Cyprus, Georgia, Indonesia, Japan, Jordan, Kazakhstan, Kyrgyzstan, Laos, Lebanon, Malaysia, Maldives, Mongolia, Myanmar, Burma, Nepal, North Korea, Oman, Philippines, Russia, Singapore, South Korea, Taiwan, Tajikistan, Thailand, Timor-Leste, Turkey, Turkmenistan, Uzbekistan, Vietnam

 

Pacific Islands

Northern Mariana Islands, the Federated States of Micronesia, Fiji, French Polynesia, Kiribati, the Marshall Islands, Nauru, New Caledonia, New Zealand, Palau, Solomon Islands, Tonga, Tuvalu, Vanuatu, Wallis, Futuna

 

 

Yes, there is an elegant solution to automatically update a picklist field based on another free text field. You can use a combination of process builder and a custom metadata type. Here are the steps to follow:

  1. Create a custom metadata type named "Territory Mapping" with the following fields:

    • Country (Text)
    • Territory (Picklist)
  2. Populate the custom metadata type with the mapping between countries and territories based on your requirements.

  3. Create a process builder on the object where you want to update the Territory field.

  4. Set the process builder to run when a record is created or edited.

  5. Add a criteria to check if the Country field has changed.

  6. Add an action to retrieve the Territory value from the custom metadata type based on the Country value.

  7. Update the record with the retrieved Territory value.

Here's an example of how the process builder action could be configured:

  • Action Type: Update Records

  • Record Type: Select the object where you want to update the Territory field.

  • Criteria for Updating Records: Select the criteria for the record that you want to update.

  • Set New Field Values: Select the Territory field and set it to the value from the custom metadata type using a formula. Here's an example formula:

    $CustomMetadata.Territory_Mapping.get($ObjectType.CustomObject__c.Fields.Country__c.getDescribe().getValue().getDescribe().getInlineHelpText()).Territory__c

This formula retrieves the Territory value from the custom metadata type based on the Country value on the record.

By using this approach, you only need to maintain the mapping between countries and territories in the custom metadata type, and any changes to the mapping will automatically be reflected in the process builder.

Hello, 

 

I was wondering if anyone has an elegant solution to automatically update a picklist field (territory) based on another free text field (country)

 

For Example. 

If Country = USA, United States, Canada 

Update Territory to North America 

 

I know I can do this via a workflow, but due to the number of countries and territories, it will become 8+ workflows. 

 

The Territory values i’m looking to automate are below. 

 

Cheers.

 

Northern Europe

Aland Islands, Denmark, Estonia, Faroe Islands, Finland, Guernsey, Iceland, Ireland, Isle of Man, Jersey, Latvia, Lithuania, Norway, Sark, Svalbard and Jan Mayen, Sweden, United Kingdom, UK, Scotland, Wales

 

Southern Europe

Albania, Andorra, Bosnia and Herzegovina, Croatia, Gibraltar, Greece, Italy, Republic of Macedonia, Macedonia, Malta, Montenegro, Portugal, San Marino, Serbia, Slovenia, Spain, Vatican City

 

Western Europe

Austria, Belgium, France, Germany, Liechtenstein, Luxembourg, Monaco, Netherlands, Switzerland

 

Eastern Europe

Belarus, Bulgaria, Czech Republic, Hungary, Poland, Moldova, Romania, Russia, Slovakia, Ukraine

 

North America

USA, US, United States, United States of America, Canada, Bermuda

 

South America

Colombia, Venezuela, Ecuador, Peru, Brazil, Argentina, Uruguay, Paraguay, Chile, Suriname, Bolivia, Guyana

 

Central America

El Salvador, Costa Rica, Belize, Guatemala, Honduras, Nicaragua, Panama

 

Middle East

Cyprus, Syria, Lebanon, Israel, the West Bank, Gaza, Jordan, Iraq, Iran, Saudi Arabia, Yemen, Oman, United Arab Emirates, Qatar, Bahrain, Kuwait,  Egypt, Libya.

 

Africa

Algeria, Angola, Benin, Botswana, Burkina Faso, Burundi, Cabo Verde, Cameroon, Central African Republic (CAR), Chad, Comoros, Congo, Democratic Republic of the Congo, Republic of the Cote d'Ivoire, Cote D’Ivoire, Djibout,

Egypt, Equatorial Guinea, Eritrea, Eswatini, Swaziland, Ethiopia, Gabon, Gambia, Ghana, Guinea, Guinea-Bissau, Kenya, Lesotho, Liberia, Libya, Madagascar, Malawi, Mali, Mauritania, Mauritius, Morocco, Mozambique, Namibia, Niger, Nigeria, Rwanda, Sao Tome and Principe, Senegal, Seychelles, Sierra Leone, Somalia, South Africa, South Sudan, Sudan, Tanzania, Togo, Tunisia, Uganda, Zambia, Zimbabwe

 

Indian SubContinent

India, Pakistan, Bangladesh, Nepal, Sri Lanka, Bhutan, and the Maldives

 

Asia

Afghanistan, Armenia, Azerbaijan, Bhutan, Brunei, Cambodia, China, Cyprus, Georgia, Indonesia, Japan, Jordan, Kazakhstan, Kyrgyzstan, Laos, Lebanon, Malaysia, Maldives, Mongolia, Myanmar, Burma, Nepal, North Korea, Oman, Philippines, Russia, Singapore, South Korea, Taiwan, Tajikistan, Thailand, Timor-Leste, Turkey, Turkmenistan, Uzbekistan, Vietnam

 

Pacific Islands

Northern Mariana Islands, the Federated States of Micronesia, Fiji, French Polynesia, Kiribati, the Marshall Islands, Nauru, New Caledonia, New Zealand, Palau, Solomon Islands, Tonga, Tuvalu, Vanuatu, Wallis, Futuna

 

 

Hello,

Certainly, to achieve the automated update of the picklist field "Territory" based on the "Country" field, you can implement a centralized solution using Process Builder or a similar automation tool in your CRM.

  1. Create Custom Metadata: Set up a custom metadata type containing "Country" and "Territory" pairs.

  2. Process Builder: Create a single Process Builder automation triggered by changes to the "Country" field.

  3. Action - Apex: Utilize an Apex invocable method within the Process Builder to query the custom metadata and update the "Territory" field accordingly.

This approach ensures streamlined maintenance and scalability as your list of countries and territories expands.

Feel free to provide your CRM platform for more specific guidance.

Best regards,

Hello, 

 

I was wondering if anyone has an elegant solution to automatically update a picklist field (territory) based on another free text field (country)

 

For Example. 

If Country = USA, United States, Canada 

Update Territory to North America 

 

I know I can do this via a workflow, but due to the number of countries and territories, it will become 8+ workflows. 

 

The Territory values i’m looking to automate are below. 

 

Cheers.

 

Northern Europe

Aland Islands, Denmark, Estonia, Faroe Islands, Finland, Guernsey, Iceland, Ireland, Isle of Man, Jersey, Latvia, Lithuania, Norway, Sark, Svalbard and Jan Mayen, Sweden, United Kingdom, UK, Scotland, Wales

 

Southern Europe

Albania, Andorra, Bosnia and Herzegovina, Croatia, Gibraltar, Greece, Italy, Republic of Macedonia, Macedonia, Malta, Montenegro, Portugal, San Marino, Serbia, Slovenia, Spain, Vatican City

 

Western Europe

Austria, Belgium, France, Germany, Liechtenstein, Luxembourg, Monaco, Netherlands, Switzerland

 

Eastern Europe

Belarus, Bulgaria, Czech Republic, Hungary, Poland, Moldova, Romania, Russia, Slovakia, Ukraine

 

North America

USA, US, United States, United States of America, Canada, Bermuda

 

South America

Colombia, Venezuela, Ecuador, Peru, Brazil, Argentina, Uruguay, Paraguay, Chile, Suriname, Bolivia, Guyana

 

Central America

El Salvador, Costa Rica, Belize, Guatemala, Honduras, Nicaragua, Panama

 

Middle East

Cyprus, Syria, Lebanon, Israel, the West Bank, Gaza, Jordan, Iraq, Iran, Saudi Arabia, Yemen, Oman, United Arab Emirates, Qatar, Bahrain, Kuwait,  Egypt, Libya.

 

Africa

Algeria, Angola, Benin, Botswana, Burkina Faso, Burundi, Cabo Verde, Cameroon, Central African Republic (CAR), Chad, Comoros, Congo, Democratic Republic of the Congo, Republic of the Cote d'Ivoire, Cote D’Ivoire, Djibout,

Egypt, Equatorial Guinea, Eritrea, Eswatini, Swaziland, Ethiopia, Gabon, Gambia, Ghana, Guinea, Guinea-Bissau, Kenya, Lesotho, Liberia, Libya, Madagascar, Malawi, Mali, Mauritania, Mauritius, Morocco, Mozambique, Namibia, Niger, Nigeria, Rwanda, Sao Tome and Principe, Senegal, Seychelles, Sierra Leone, Somalia, South Africa, South Sudan, Sudan, Tanzania, Togo, Tunisia, Uganda, Zambia, Zimbabwe

 

Indian SubContinent

India, Pakistan, Bangladesh, Nepal, Sri Lanka, Bhutan, and the Maldives

 

Asia

Afghanistan, Armenia, Azerbaijan, Bhutan, Brunei, Cambodia, China, Cyprus, Georgia, Indonesia, Japan, Jordan, Kazakhstan, Kyrgyzstan, Laos, Lebanon, Malaysia, Maldives, Mongolia, Myanmar, Burma, Nepal, North Korea, Oman, Philippines, Russia, Singapore, South Korea, Taiwan, Tajikistan, Thailand, Timor-Leste, Turkey, Turkmenistan, Uzbekistan, Vietnam

 

Pacific Islands

Northern Mariana Islands, the Federated States of Micronesia, Fiji, French Polynesia, Kiribati, the Marshall Islands, Nauru, New Caledonia, New Zealand, Palau, Solomon Islands, Tonga, Tuvalu, Vanuatu, Wallis, Futuna

 

 

Hello,

Certainly, to achieve the automated update of the picklist field "Territory" based on the "Country" field, you can implement a centralized solution using Process Builder or a similar automation tool in your CRM.

  1. Create Custom Metadata: Set up a custom metadata type containing "Country" and "Territory" pairs.

  2. Process Builder: Create a single Process Builder automation triggered by changes to the "Country" field.

  3. Action - Apex: Utilize an Apex invocable method within the Process Builder to query the custom metadata and update the "Territory" field accordingly.

This approach ensures streamlined maintenance and scalability as your list of countries and territories expands.

Feel free to provide your CRM platform for more specific guidance.

Best regards, white forum

 

Reply