---
schema_version: "1"
id: e23681abfe46b0a55ebba6cd4faa201e2b84e604b17019235b30935b4515513c
title: Convert Country Names to Codes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/sales_planning_convert_country_codes.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.sales_planning_convert_country_codes.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 3a316498ce471a41c010c79cf2c0958df704f1e4f4735c325e47b770234a3324
description: Ensure accurate unit assignments to boundaries when you replace country names with codes in Territory Planning live datasets by updating a recipe. Without country codes, your sales plans can include inaccurate assignments.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# Convert Country Names to Codes

Ensure accurate unit assignments to boundaries when you replace country names with codes in Territory Planning live datasets by updating a recipe. Without country codes, your sales plans can include inaccurate assignments.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions with Web Services API enabled</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col>
          <col>
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d40805e73">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d40805e73 ">To convert country names to codes with recipes:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d40805e73 ">
              <p>Sales Planning Admin permission set</p>
              <p>AND</p>
              <p>One of these:</p>
              <ul>
                <li>Data Pipelines Base User permission set</li>

                <li>CRM Analytics Plus Admin permission set</li>

                <li>CRM Analytics Growth Admin permission set</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/images/icon_note.png)

Note If you prefer not to use recipes, add country codes to data sources in Sales Planning or directly to alignments. See the linked resources for more details.

1. From Setup, in the Quick Find box, enter Data Pipeline, and then select **Getting Started**.
2. Click **Launch Data Manager**. Then click **Recipes**.
3. Open a recipe.
4. Add a transform node before the Output node.
5. Click **Formula** in the Transform section, and then **Custom Formula**.
    
    ![Formula for converting country name to code in a recipe.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-sales-sales_performance_management-264-0-0-production-enus/b1f2feb4-26b8-444f-97f7-be2349869d93/sales_performance_management/images/territory_planning_country_name_conver.png)
6. In Formula Editor, create a formula to covert each value in your country attribute to its corresponding country code.
7. For the Output Type, select **Text**.
8. Click **Apply**.
9. Test the formula in the Preview panel and confirm it works as you expect.
10. Save and run the recipe.
11. Add the country code attribute to a [data source](https://help.salesforce.com/s/articleView?id=sales.data_sources_management_add_sources.htm&language=en_US) or [territory plan alignment](https://help.salesforce.com/s/articleView?id=sales.sales_planning_country_codes_alignments.htm&release=264.0.0&type=5 "Plan territories with more accuracy when you add country code attributes to your units in Territory Planning.").

#### See Also

- [Let Users Select States, Countries, and Territories from Picklists](https://help.salesforce.com/s/articleView?id=xcloud.admin_state_country_picklists_overview.htm&language=en_US)
- [Create Custom Fields](https://help.salesforce.com/s/articleView?id=platform.adding_fields.htm&language=en_US)