Skip to main content

Hi team we are running into an error on a newly created flow that attempt to grab the Home Country from a Contact record and populate the Country field on a custom address on a case, and wondering if this is a known limitation.  The error message is: 

 

Error Occurred: This error occurred when the flow tried to create records: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST: Non-Salesforce Location (Country/Territory): bad value for restricted picklist field: Andorra. You can look up ExceptionCode values in the

SOAP API Developer Guide

 

Note we copied the actual Country name from the State and Country/Territory Picklist into the Contact Home Country field.   

 

Here's the detailed error I received in an email: 

 

Flow Error Details

 

 

Flow Details

 

 

Flow API Name:

GSS_Outreach_Create_HS_Case 

Type:

Autolaunched Flow 

Version:

13 

Status:

Active 

Org: SFDC Corporate Security (00DMN0000005GQj)

 

Flow Interview Details

 

 

Interview Label:

GSS_Outreach - Create H&S Case 2/5/2025 10:21 AM 

Interview GUID:

656c2a4c4e12ae42e923292545e194d36eca6f-108d 

Current User:

Scott Duhaime (005MN000000a18r) 

Start time:

2/5/2025 10:21 AM 

Duration:

0 seconds 

 

How the Interview Started

 

Scott Duhaime (005MN000000a18r) started the flow interview. 

API Version for Running the Flow: 62 

Some of this flow's variables were set when the interview started. 

$Record = GSS_Outreach__c (aAgMN00000003Vl0AI)

GET RECORDS:

GR01: Get Case H&S Record Type 

Find all RecordType records where: 

DeveloperName Equals Health_Safety 

AND SobjectType Equals Case 

Store the values of these fields in GR01_Get_Case_Record_Type: Id 

Result

 

Successfully found records.

GET RECORDS:

GR02: Get H&S Case Queue 

Find all Group records where: 

DeveloperName Equals Health_Safety_Support 

Store the values of these fields in GR02_Get_Case_Queue: Id 

Result

 

Successfully found records.

ASSIGNMENT:

AS01: Set H&S Case Fields 

{!varCase.Incident__c} Equals {!$

Record.GSS_Incident__r.Id

{!varCase.ContactId} Equals {!$

Record.GSS_Contact__r.Id

{!varCase.RecordTypeId} Equals {!GR01_Get_Case_Record_Type.Id} 

{!varCase.OwnerId} Equals {!GR02_Get_Case_Queue.Id} 

{!varCase.Category__c} Equals Traveler Assistance 

{!varCase.Sub_Category__c} Equals Disaster/Hardship Support 

{!varCase.Region__c} Equals {!$Record.GSS_Incident__r.Region__c} 

{!varCase.Origin} Equals Internal 

{!varCase.Location_Type__c} Equals Non-Salesforce Location 

{!varCase.Non_Salesforce_Location__City__s} Equals {!$Record.GSS_Contact__r.HomeAddress_City__c} 

{!varCase.Person_Type__c} Equals Employee 

{!varCase.Injured_Employee_Email__c} Equals {!$Record.GSS_Contact__r.Email} 

{!varCase.Non_Salesforce_Location__CountryCode__s} Equals {!$Record.GSS_Contact__r.HomeAddress_Country__c} 

{!varCase.Description} Equals {!Descriptionformula} 

Result

 

{!varCase.ContactId} = "003MN000008qRkKYAU" 

{!varCase.Description} = "CARE Assistance Offered<p>Offered</p>" 

{!varCase.Location_Type__c} = "Non-Salesforce Location" 

{!varCase.Region__c} = "ANZ" 

{!varCase.Non_Salesforce_Location__City__s} = "Andorra la Vella" 

{!varCase.RecordTypeId} = "0127y000005lfmPAAQ" 

{!varCase.OwnerId} = "00G50000003ReiMEAS" 

{!varCase.Person_Type__c} = "Employee" 

{!varCase.Incident__c} = "0nyMN00000037BRYAY" 

{!varCase.Non_Salesforce_Location__CountryCode__s} = "Andorra" 

{!varCase.Sub_Category__c} = "Disaster/Hardship Support" 

{!varCase.Injured_Employee_Email__c} = "null" 

{!varCase.Category__c} = "Traveler Assistance" 

{!varCase.Origin} = "Internal"

CREATE RECORDS:

CR01: Create H&S Case 

Create Case records using the values that are stored in {!varCase}. 

Variable Values

 

[Incident__c=0nyMN00000037BRYAY,ContactId=003MN000008qRkKYAU,RecordTypeId=0127y000005lfmPAAQ,OwnerId=00G50000003ReiMEAS,Category__c=Traveler Assistance,Sub_Category__c=Disaster/Hardship Support,Region__c=ANZ,Origin=Internal,Location_Type__c=Non-Salesforce Location,Non_Salesforce_Location__City__s=Andorra la Vella,Person_Type__c=Employee,Injured_Employee_Email__c=null,Non_Salesforce_Location__CountryCode__s=Andorra,Description=CARE Assistance Offered<p>Offered</p>] 

Result

 

Failed to create records.

Error Occurred: This error occurred when the flow tried to create records: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST: Non-Salesforce Location (Country/Territory): bad value for restricted picklist field: Andorra. You can look up ExceptionCode values in the SOAP API Developer Guide.

4 respostas
  1. 5 de fev. de 2025, 20:23

    Hi Scott, 

     

    The country field you're trying to map to, Non_Salesforce_Location__CountryCode__s, is a sub-field (as denoted by the __s) to a custom Address type field. Valid values are actually configured in Setup:

    Hi Scott, The country field you're trying to map to, Non_Salesforce_Location__CountryCode__s, is a sub-field (as denoted by the __s) to a custom Address type field.Valid values for this field are country codes,

    not full names. The Contact field you're mapping from appears to be a regular custom field, probably a picklist. 

     

    So the data won't map properly (Full Country Name vs Country Code). 

     

    You'll need to replace one of these fields so they're both the same type or map the Country codes in the flow (which would be a pain).

0/9000