Conditionally send emails based on zip code value on the Address Field

  • jacktreed
    Asked on September 19, 2017 at 5:34 PM

    I understand the conditional logic for changing an email recipient based on a users answer. But the address block is like one field. So my options for the "state" are either filled or not filled. How can I run conditional logic on the the zip code specifically?

  • Support_Management Jotform Support
    Replied on September 19, 2017 at 6:05 PM

    You're right - The STATE options for the Address Field are limited to the following:

    Conditionally send emails based on zip code value on the Address Field Image 1 Screenshot 40

    Since your aim is to check the value they entered in the Zip Code field specifically, I'm thinking the Form Calculation Widget will fit your needs. The idea is to pass the value of the entire Address Field to the Form Calculation Widget, then use the "Contains" STATE to check whether the Address Field has a particular ZIP Code value.

    Here's a test form showing this idea.

    https://www.jotform.com/72617061288964 

    The condition here is to simply show a Text Field if it's true. The same idea should apply if you need to send an email based on the Zip Code value.

    IF Address Field CONTAINS 90210 THEN SHOW the Text Field

    Conditionally send emails based on zip code value on the Address Field Image 2 Screenshot 51

    To pass the Address Field to the widget, add a Form Calculation Widget to your form > click the ADD FIELDS button > select your Address Field > then ensure the field has a brown background (indicates text/string).

    Conditionally send emails based on zip code value on the Address Field Image 3 Screenshot 62

    Related guide: How-to-Manipulate-Text-String-with-Conditions-and-Calculation