0

Our leads come in with just a phone number. I am looking to populate a custom field for the Lead State based off of that area code. I have already added a custom formula field to populate the time zone based off of the area code but I cannot create a custom formula field to populate the State based off of the area code because the formula will exceed the character limit. I also created another custom formula field to extract just the area code from the lead phone field. How do I take what I have now to use the area code to populate the State abbreviation into another field?

Update 1: Here is what I have tried (this works, but need 4 workflow rules because character count on each is ~3600; when I only have 2 of the 4 activated, it works, but I cannot add a 3rd or 4th activated rule, will just return a Null answer)

IF(Lead_copied_area_code__c = 808 , "HI",
IF(Lead_copied_area_code__c = 907, "AK",
IF(Lead_copied_area_code__c = 334, "AL",
IF(Lead_copied_area_code__c = 251, "AL",...

Also tried:

IF( CONTAINS(TEXT( Lead_copied_area_code__c ) , "334:251:205:938:256") , "AL", 
IF( CONTAINS(TEXT( Lead_copied_area_code__c ) , "501:479:870") , "AR", 
  • did you consider process builder or workflows to segment the problem down to sets of area codes (and hence bypass the formula size limit)? – cropredy Jun 18 '18 at 23:05
  • If you have list of possible area code and state values, store them as custom setting. Use trigger to update lead by checking custom setting values. – Reshma Jun 19 '18 at 6:04
  • @cropredy I tried a workflow rile with field update using this formula but it doesnt work: IF( CONTAINS(TEXT( Lead_copied_area_code__c ) , "334:251:205:938:256") , "AL", IF( CONTAINS(TEXT( Lead_copied_area_code__c ) , "501:479:870") , "AR", IF( CONTAINS(TEXT( Lead_copied_area_code__c ) , "684") , "AS", NULL))) – Dennis Jun 19 '18 at 16:33
  • @Reshma How would I configure this? – Dennis Jun 19 '18 at 16:33
  • Dennis - please use edit to amend your question with your WF solution. Debugging via comments is not practical. You will need multiple workflow rules to avoid the formula size restriction (or multiple PB decisionblocks|action groups – cropredy Jun 19 '18 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.