Skip to main content

I have lead forms coming from Facebook, pushing into Salesforce. 
The forms have Zip but no State. Salesforce will not input the zip code because it doesn’t have the state info.

How could I lookup the state by zip and create new ‘State’ field in my existing form before sending it to Salesforce.

FYI: I know nothing of programming, but Zapier logic makes sense to me.

Thanks,

Shannon D

Hi @ShannonD 

You either need to have a lookup table that has the Zip to State relationships.

Or you would need to use an API that can take a Zip and return a State. (https://app.zipcodebase.com/documentation)

Lookup Table resources:

 


Ok, I just read another reply you had on this subject previously.
Would that lookup table need to list each and every zip - 78681 = texas, and on and on?


Or could it list the range of zips per state similar to:
 

  if (zipcode >= 35000 && zipcode <= 36999) {

      st = 'AL';

      state = 'Alabama';

 

} else if (zipcode >= 85000 && zipcode <= 86999) {

      st = 'AZ';

      state = 'Arizona';

 

Thanks,
SD


@ShannonD 

If you want to use Code, then use the Code app: https://zapier.com/apps/code/help