Get Zip By City
  • 30 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Get Zip By City

  • Dark
    Light

Article summary

Step Details

Introduced in Version4.0.0
Last Modified in Version7.1.0
LocationIntegration > USPS

The Get Zip By City step returns the zip code of the specified city.

Prerequisites 

This step requires the USPS module to be installed before it will be available in the toolbox. 


Properties

Inputs

PropertyDescriptionData Type
Address1Defines the first line of the desired addressString
Address2Defines the second line of the desired addressString
CityDefines the city of the addressString
StateThe 2 letter abbreviation of the state (ie. VA for Virginia)String

Outputs

PropertyDescriptionData Type
OutputOutputs the zip code of the specified addressString

Example Inputs and Outputs

Address1Address2CityStateOutput
650 Providence RoadNullChesapeakeVA23325
4850 West RoadSuite 112NorfolkCAEXCEPTION MESSAGE
NullApartment 102El PasoTXEXCEPTION MESSAGE
Empty IgnoreRichmondVAEXCEPTION MESSAGE


Common Errors

Address Not 

If the Address1 field has a null or empty value, the step will cause an error.

To correct this, ensure the value entered or mapped to the field is valid.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Zip By City 1[GetZipByCity] in flow [Flow 1]: Exception invoking method GetZipByCity on class USPSSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method GetZipByCity on class USPSSteps
 ---> Decisions.USPS.USPSException: Address Not Found. 
at Decisions.USPS.USPSSteps.GetZipByCity(String address1, String address2, String city, String state)
   --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
   --- End of inner exception stack trace ---

Invalid City

If the City or State values are null, empty, or invalid, the step will cause an error.

To correct this, ensure that the values for the fields are mapped or entered correctly.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Zip By City 1[GetZipByCity] in flow [Flow 1]: Exception invoking method GetZipByCity on class USPSSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method GetZipByCity on class USPSSteps
 ---> Decisions.USPS.USPSException: Invalid City. 
at Decisions.USPS.USPSSteps.GetZipByCity(String address1, String address2, String city, String state)
   --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
   --- End of inner exception stack trace ---

Related Information

Forum Posts:
USPS Module Example: Get City & State By Zip
 USPS Address Verification Service
Get State From Zip


Was this article helpful?