Print this page

Identity Connect error related to Country during sync: " There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries: Country"

Knowledge Article Number 000193419
Description When running a sync in Identity Connect the following error occurs and the sync for a AD (Active Directory) User to Salesforce fails:
There's a problem with this country, even though it
may appear correct. Please select a country from the list of valid countries: Country
This error will mostly be seen when State and Country Picklists have been enabled in Salesforce. The enablement and configuration of State and Country Picklists can be found in Salesforce within Setup>>State and Country Picklists.
Some of the concepts and examples mentioned in this article refer to the State and Country Picklists configuration in Salesforce. For more information on this please refer to the Salesforce documentation for more information on this feature.
The error occurs due to the country string being used in the address for a AD (Active Directory) User not being mapping to a country in the State and Country Picklists in Salesforce.
The following will go over a example scenario which caused this error and a solution will be detailed in the Resolution section for this article.
This article assumes State and Country Picklists have been configured and enabled in Salesforce and existing data converted.
In this example scenario, a address has been added for the AD (Active Directory) User named ICTestUser30 and the country added the address for this user is United States See the screen shot below from the AD (Active Directory) properties for this user which which shows the Address tab.
User-added image

Now the State and Country Picklists will be examined in Salesforce. Within Salesforce navigate to Setup>>State and Country Picklists and click on the Configure States and Countries link which will bring up the Configure States and Countries screen.  
From the Configure States and Countries screen under the Countries related list find United States and click on the Edit link which will bring up the Country Details screen for United States. When Identity Connect performs a sync it will take the Country for the AD (Active Directory) User and try and map the Country based on the Integration Value for the country as shown on the Country Detail screen for the Country in Salesforce.. Notice from the screen shot below the Integration Value for United States is United States and the Country given in AD (Active Directory) for the ICTestUser30 user is also United States as shown in the screen shot above.
User-added image
From the information above there is a match between the Country in AD (Active Directory) for this user and the Integration Value for this Country in Salesforce still, the following error occurred when when a sync is performed for this user.
There's a problem with this country, even though it
may appear correct. Please select a country from the list of valid countries: Country

The next step in determining the reason for this error would be to examine the ICTestUser30 user in Identity Connect to see the values that are being read in from AD (Active Directory). This can be done by going into the Identity Connect Admin and navigating to Salesforce Org>>Mapping>>Attribute Mapping. From the Attribute Mapping screen click in the Sample User text box in the upper right hand corner of the screen and put in the name for the sample user to to look at in this example that would be ICTestUser30 and select that user from the list that comes up.

User-added image

Once the ICTestUser30 is selected the Attribute Mapping screen will show Salesforce fields under the Salesforce column and the AD (Active Directory) fields they are mapped to under the Active Directory column.

The Sample column will show a example of the data which will would sync into Salesforce from AD (Active Directory) for the ICTestUser30 user. In the screen shot below notice the Country field under the Salesforce column is mapped to the c field in Active Directory column and under the Sample column us a value of US.

User-added image

In this example the problem is the Integration Value in Salesforce for United States is United States but, the value we are passing during the sync is the US which is the Country Code not the Country. This is also known because the c AD (Active Directory) attribute represents Country Code in AD (Active Directory).  This causes a mismatch and the error mentioned above is thrown. 

See Resolution section for a solution to this problem.


Resolution In order to fix the problem described in this example scenario. The Integration Value in Salesforce for Country and AD Active (Directory for Country being passed in should match (as seen on the Attribute Mapping screen).. 

There are several ways to address this issue.

Change the Integration Value in Salesforce to match what is coming in from AD (Active Directory). Using this example scenario, that would mean changing the Integration Value in Salesforce from United Sates to US.

User-added image
The other option is to make some changes to the Identity Connect mapping attributes for Country so, that it matches the Integration Value in Salesforce. 

For example, the Integration Value in Salesforce for United States is "United States".

In Identity Connect the Attribute Mapping screen shows the following for Country see screen shot below:

User-added image
Notice the the value in the Sample column is US. This will cause the error due to the mismatch between the AD (Active Directory) value US and the Integration Value in Salesforce which is United States.

There are two user attributes in AD (Active Directory), c (Country Code) and co (Country) which stores the Country Name. By default, Identity Connect maps using c (Country Code). In this example, if the mapping was changed to use the AD (Active Directory) value of co (Country) instead there would be a match for Country between the value in AD (Active Directory) and the Integration Value in Salesforce.

To make this change,  In the Identity Connect Administrator navigate to the Salesforce Org tab and click on the Mapping tab.  

Under the Salesforce column double click on the Country row and this will bring up the Salesforce Attribute screen for the Country field.  Select the Attribute List tab and in the drop down list box delete any values you see, blanking out the field.

User-added image

Click on the Transformation Script tab and add the following JavaScript.
In this example, the JavaScript added sets the Salesforce Country field to the AD (Active Directory.) co (Country) attributes value.

User-added image
After making this change examine the Example Result and then select the Update button this will bring you back to the mapping screen where the changes can be saved. Notice, the Sample value for Country is now United States which is reflective of the given JavaScript rule and matches the Salesforce Integration Value
See the example screen shot below, which shows snip it of the Salesforce Intergration Value for United States, the Identity Connect Mapping screen for Country and the AD (Active Directory) attribute for co for the test user for this example  ICTestUser30. All the values circled in red match and therefore will sync without error. 

User-added image


promote demote