Get Cities By Zips
  • 30 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Get Cities By Zips

  • Dark
    Light

Article Summary

Step Details

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

The Get Cities By Zips step returns the list of cities of the specified zip codes.

Prerequisites 

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


Properties

Inputs

PropertyDescriptionData Type
Zip 5 CodesThe list of zip codesList of String

Outputs

PropertyDescriptionData Type
OutputThe part of the string that was extracted.List of String

Example Inputs and Outputs

InputOutput
23455, 23606VIRGINIA BEACH, NEWPORT NEWS
2344, 23325EXCEPTION MESSAGE
23456VIRGINIA BEACH
NullEXCEPTION MESSAGE
EmptyEXCEPTION MESSAGE



Common Errors

ZIPCode must be 5 characters 

If one of the zip codes entered is less than 5 characters, the step will cause an error.

To correct this, ensure each zip code is correctly formatted.

Exception Message:

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

If the USPS module does not find one of the zip codes entered, the step will cause an error.

To correct this, ensure that all zip codes entered or mapped are correct.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Cities By Zips 1[GetCitiesByZips] in flow [Flow 1]: Exception invoking method GetCitiesByZips on class USPSSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method GetCitiesByZips on class USPSSteps
 ---> Decisions.USPS.USPSException: Invalid Zip Code. at Decisions.USPS.USPSSteps.GetCitiesByZips(String[] zip5Codes)
   --- 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?