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

Get City By Zip

  • Dark
    Light

Article Summary

Step Details

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

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

Prerequisites 

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


Properties

Inputs

PropertyDescriptionData Type
Zip5 The desired 5-digit zip codeString

Outputs

PropertyDescriptionData Type
OutputThe city name of the desired zip codeString

Example Inputs and Outputs

Zip5Output
23462VIRGINIA BEACH
23325CHESAPEAKE
2325EXCEPTION MESSAGE
Null[]
Empty EXCEPTION MESSAGE


Common Errors

ZIPCode must be 5 characters

If the zip code has fewer than 5 characters, the step will cause an error.

To correct this, ensure that the correct number of characters is mapped or entered.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get City By Zip 1[GetCityByZip] in flow [Flow 1]: Exception invoking method GetCityByZip on class USPSSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method GetCityByZip on class USPSSteps
 ---> Decisions.USPS.USPSException: ZIPCode must be 5 characters 
at Decisions.USPS.USPSSteps.GetCityByZip(String zip5)
   --- 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 ---

Incorrect Parameter Count, Data Not Mapped Correctly

If the zip code is empty, the step will cause an error.

To correct this, ensure that the correct number of characters is mapped or entered.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get City By Zip 1[GetCityByZip] in flow [Flow 1]: Incorrect Parmater Count, Data Not Mapped Correctly
 ---> DecisionsFramework.LoggedException: Incorrect Parmater Count, Data Not Mapped Correctly
 ---> System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture
 at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data)
   --- 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 ---

Was this article helpful?