--- title: "Get Cities By Zips" slug: "get-cities-by-zips" tags: ["City", "zip", "USPS", "module"] updated: 2025-08-21T14:49:10Z published: 2025-08-21T14:49:10Z canonical: "documentation.decisions.com/get-cities-by-zips" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Get Cities By Zips | ## Step Details | | --- | | **Introduced in Version** | 4.0.0 | | **Last Modified in Version** | 8.1.0 | | **Location** | Integration > 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](https://documentation.decisions.com/docs/installing-modules-decisions) before it will be available in the toolbox. --- ## Properties #### Inputs | Property | Description | Data Type | | --- | --- | --- | | Zip 5 Codes | The list of zip codes. | List of String | #### Outputs | Property | Description | Data Type | | --- | --- | --- | | Output | The part of the string that was extracted. | List of String | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-08-21_10h07_31.png) --- ## Example Inputs and Outputs | Input | Output | | --- | --- | | 23455, 23606 | VIRGINIA BEACH, NEWPORT NEWS | | 2344, 23325 | EXCEPTION MESSAGE | | 23456 | VIRGINIA BEACH | | Null | EXCEPTION MESSAGE | | Empty | EXCEPTION 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: ```csharp 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: ```csharp 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 --- ``` --- Related Information Forum Posts: [USPS Module Example: Get City & State By Zip](https://support.decisions.com/forum/topic29233-usps-module-example-get-city--state-by-zip.aspx) [USPS Address Verification Service](https://support.decisions.com/forum/topic1802-usps-address-verification-service.aspx) [Get State From Zip](https://support.decisions.com/forum/topic3107-usps-integration-get-state-from-zip.aspx) ## Related - [Get Zip By City](/get-zip-by-city.md) - [Is Zip Valid For City](/is-zip-valid-for-city.md) - [Get City By Zip](/get-city-by-zip.md)