Is Zip Valid For City
  • 30 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Is Zip Valid For City

  • Dark
    Light

Article Summary

Step Details

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

The Is Zip Valid For City step determines whether the input zip is correct for 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
CityThe desired city to evaluateString
ZipThe desired zip code to evaluateString


Common Errors

ZIPCode must be 5 characters

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

To correct this, ensure that the value length is 5 characters.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Substring 1[Substring] in flow [Display Steps]: Exception invoking method Substring on class StringSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method Substring on class StringSteps
 ---> System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length') 
   at System.String.Substring(Int32 startIndex, Int32 length)    
   --- 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 ---

Object reference not set to an instance of an object

If the City value is null or empty, the step will cause an error.

To correct this, ensure that the value is configured correctly.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Is Zip Valid For City 1[IsZipValidForCity] in flow [Flow 1]: Exception invoking method IsZipValidForCity on class USPSSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method IsZipValidForCity on class USPSSteps
 ---> System.NullReferenceException: Object reference not set to an instance of an object. 
at Decisions.USPS.USPSSteps.IsZipValidForCity(String zip, String city)
   --- 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 Address Verification Service Integration
USPS Integration: Get State From Zip
USPS Module Example: Get City & State By Zip


Was this article helpful?