What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can I use conditional logic to remove empty address fields from notification and auto-responder emails?

    Asked by greenbank on September 15, 2013 at 07:21 PM

    Hi,

    I'm setting up a form for use by someone who will copy and paste the values to a spreadsheet and used your excellent "remove headers" tip for the address fields of the notification and auto-responder emails.

    However, this will now render blank lines in an address, which doesn't look good. For example, the email content for field "address" has the following tags for output: 

    {address:addr_line1}
    {address:addr_line2}
    {address:city}
    {address:state}
    {address:postal}
    {address:country}

    This gives output, when all fields are complete, similar to:

    134 West Acre Drive
    Tommbley
    Dallas
    Texas
    3123254
    United States

    However, if any field is left blank, we get: 

    134 West Acre Drive

    Dallas
    Texas

    United States

    So, I'd like to only output fields with values to give output like the following:

    134 West Acre Drive
    Dallas
    Texas
    United States

    Can this be done?

    Thank you in advance for your help and awesome form service.

    Best regards,

    Craig

    -------------------------------------------------------------------------------------

    Hi Jonathan,

    Thank you for the fast reply.

    I've tried that option but still the problem persists. The notification email I'm using is, I thought, the "default email notifier" but with relevant recipient addresses altered.

    Any ideas?

    Regards,

    Craig

    Screenshot
    Emails Address Fields email style size
  • Profile Image
    JotForm Support

    Answered by jonathan on September 15, 2013 at 08:04 PM

    Hi,

    You can already hide empty fields on the email from within the form builder.

    Follow this steps to do this.

    1. Click on Setup & Embed

    2. Preferences

    3. Advance Settings

    4. On the option Hide Empty Fields on Emails , set the value to Enabled.

     

    Please inform us if this does not work for you.

    Thanks.