Territory Rules for Accounts in EU Countries and Accounts in Bay Area, CA - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Amy FrankelAmy Frankel 

Territory Rules for Accounts in EU Countries and Accounts in Bay Area, CA

Hello Community!

I've set up a territory and rule for Accounts with EU country codes. The problem is I didn't see a way to filter on country code "is among" so I just did "contains" and added all the 2-letter codes separated by commas. It worked OK, except there are some accounts where the country field has the country name spelled out, and it's showing any of those that contain those letters even if they're not in the EU. Is there an easier way to go about doing this?

EU Rule

I'm also going to want to set up a territory rule for Bay Area accounts so we can invite them to certain events, and I think trying to figure out all those zip codes for a rule is going to be very challenging. Any advice would be appreciated, thank you!
Best Answer chosen by Amy Frankel
Mikey BrownMikey Brown
Hi Amy, 

Have you tried adjusting your rule to EQUALS rather than Contains?

I believe with comma separated values it will treat each of those as OR operators, so that if you have Billing Country = AT,BE,BG it would be treated as
  • Billing Country = AT, the  OR
  • Billing Country = BE, OR
  • Billing Country = BG, OR etc.
That said, you might have to include the full out spellings to make sure you're capturing everything. For example, if you have Billing Country = US, and some people are spelling out United States, you might need to include 
  • Billing Country = US,United States
As far as your Bay Area Accounts, I would try and run the rule off of cities in the Bay Area rather than Zip Codes as that can be quite cumbersome to maintain.  Alternatively, you could potentially build a custom object of zip codes and their corresponding Region, and use automation to reference this table and populate the appropriate value on your Account, and then build the Territory off of this field if that makes sense. 

Thanks!
Mikey

All Answers

Mikey BrownMikey Brown
Hi Amy, 

Have you tried adjusting your rule to EQUALS rather than Contains?

I believe with comma separated values it will treat each of those as OR operators, so that if you have Billing Country = AT,BE,BG it would be treated as
  • Billing Country = AT, the  OR
  • Billing Country = BE, OR
  • Billing Country = BG, OR etc.
That said, you might have to include the full out spellings to make sure you're capturing everything. For example, if you have Billing Country = US, and some people are spelling out United States, you might need to include 
  • Billing Country = US,United States
As far as your Bay Area Accounts, I would try and run the rule off of cities in the Bay Area rather than Zip Codes as that can be quite cumbersome to maintain.  Alternatively, you could potentially build a custom object of zip codes and their corresponding Region, and use automation to reference this table and populate the appropriate value on your Account, and then build the Territory off of this field if that makes sense. 

Thanks!
Mikey
This was selected as the best answer
Mikey BrownMikey Brown
Also, it sounds like you aren't using State and Country picklists which is somethiing I would certainly recommend. This basically converts the Billing State and Country fields into picklist fields and makes sure that users are entering data the same way each time. This is extremely useful for reporting and rule-based assignments. It can be a bit of up front work to get the data in a good place, but it is well worth the time in the long run! https://help.salesforce.com/articleView?id=admin_state_country_picklists_configure.htm&type=5

 
Amy FrankelAmy Frankel
Thanks, @Mikey Brown! The "equals" seemed to work! I did look into implementing the picklists a while ago and it looked to be a beast as it could cause problems with some of our existing integrations (most of our information comes from online donation forms and not from user data entry). I started doing some of the cleanup/groundwork, but just got too indimidated about what could go wrong!
Mikey BrownMikey Brown
Awesome, I'm glad it's working for you! And yeah, if you have integrations that is passing the country information into Salesforce, this would certainly be a much more coordinated effort. You would either need to put some work on the user entry side to either capture the data in the same way it's set up in Salesforce, or you would need to put in automation to clean up the user entered data after it's passed to Salesforce. The time of that effort could certainly outweigh the effort of having to make sure you're accounting for different country spellings in your territory rules. 

Also, if need be, you should be able to split out the rules if you are running into limits. I can't remember the cutoff, but your rule rule criteria can only be so long. If you include the full spelling for each of the country abbreviations, you may hit that limit, but if need be you can just split that rule into two and you should be fine. For example, you could have rule look at countries AT - FR, and the second rule looks at countries GR - SK. 

Thanks,
Mikey
Amy FrankelAmy Frankel
Good tip, Mikey, thanks again!