function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kent ManningKent Manning 

How does on deal with the ZIP+4 in a workflow rule criteria?

I have a workflow rule criteria that must check zip code ranges for states such as NY and CA.  Here is the code segment.

State_of_Primary_Contact__c = "ID"|| 
(State_of_Primary_Contact__c = "NY" && Value(Postal_Code_of_Primary_Contact_hidden__c) >= 12000 && Value(Postal_Code_of_Primary_Contact_hidden__c) <= 14901) || 
(State_of_Primary_Contact__c = "CA" && Value(Postal_Code_of_Primary_Contact_hidden__c) >= 94000 && Value(Postal_Code_of_Primary_Contact_hidden__c) <= 95999) 
) 

 By using the Value() function, I'm able to convert the text postal code in to a number and then use the "<=" or ">=" operators to test for valid zip code ranges. This works fine until you get a Zip+4 zip code such as 92038-0685.  How can I test a range of zip codes when there is the +4 extension on the number?  

 

I hope someone has run into this situation before.

 

Thanks in advance!

 

 

Steve :-/Steve :-/

I think you might have to use a LEFT function to grab the first 5 digits of Zipcode

Kent ManningKent Manning

Thanks Steve, that's exactly what I ended up doing.  My formula is Value(Trim(Left(mailingpostalcode, 5))).