I'm importing CSV data from another system into SalesForce. The field for State is going into a custom text field. Then I have workflow rule with Field Updates to populate the built in address and state. However the State field in SalesForce is a picklist, where I'm getting an abbreviated two letter code from the other system. I've been searching for and found a way to get picklist value, but not how to set it. Is there a built-in function for this? Also I would need to covert AL to Alabama and similar for all states. Any help is appreciated!
1 Answer
Setting a picklist value in a formula is like setting a string, but the value should just be in the picklist.
In the background the state and country picklists are using the standard ISO codes for storing data. It only shows you "Alabama" on the page because it takes advantage of translations, when really "AL" is the value in the background. That is the value you want to save into the standard field with your workflow. The same goes for country codes. You want to us "US" for the United States.
-
This is the formula I have IF(NOT(ISBLANK(Home_State__c)), Home_State__c, "") and it updates the Contact: Mailing State/Province field. Home_State__c is the two letter code, while Contact: Mailing State/Province is looking for the full state name. Any easy way to do that or I need to add IF statement for all 50 states? :) Commented Mar 27, 2015 at 3:14
-
What is happening right now when this workflow fires? Is it giving an error or is it showing up as only the abbreviation?– CyberJusCommented Mar 27, 2015 at 13:02
-
Yea, it gives error. This example works IF(AND(NOT(ISBLANK(Home_State__c)), Home_State__c = "VA"), "Virginia", "") but then I would need to add the same statement for every state. Not sure if there is a way to change Contact: Mailing State/Province to use the two letter code, instead of full state name Commented Mar 27, 2015 at 13:52
-
The fields you want to use all end in Code like MailingStateCode and MailingCountryCode (that is the API name, they should be something similar in the workflow)– CyberJusCommented Mar 27, 2015 at 14:19