Community > Answers
69 views

If field is blank when submitting liveform, not show content in email template

We have a form were there are a set of 3 questions each for 6 different categories that a user can select their top 2 categories and the form would display the 3 related questions for each of those categories. All that is setup and works fine. 

My question is, on the email template that goes to the Admin to receive the information once submitted, is there way to setup the email template so that the other categories of questions that they did not answer (and were technically hidden from the user based off their selections) would not show up in the email template.

Simple Example: if we have a text field for the "Name" that was not a required field. 

In the email template we would have setup:
Name: [Name]

If they left this field blank when the form was submitted the email template would come through as:
Name: (blank)

So is there some way to make the whole part of " Name: [Name] " not show up in the template if there was no information input into the field?

Sorry this maybe a silly question, I am not a developer so I may be thinking about this the wrong way but any guidance would be helpful. 

Thanks

Jerod Brown Jerod Brown
asked 06/26/2020 15:17

endorsed by
  • Keston Pollard
Add Comment
Last Activity 07/09/2020 04:14

1 Answer(s)

  • answered 06/29/2020 08:26
    Ashish Pachori
    Add Comment
    Jerod Brown
    replied 07/08/2020 15:14

    I have the latest version 5.9.3 installed on this website. And for the email response, I just tested this again, and clicked the auto generate the email, so it would grab all of my fields and the tokens for them. 

    For the fields that were left blank on the form, the label still comes through in the email with a blank area where the answer would go, but it did not leave the label off of the email with the field being left blank. 

    Here is a screen shot. 

    https://www.dropbox.com/s/dwfzmcbaeor02t7/Screenshot%202020-07-08%2011.13.38.png?dl=0

    Ashish Pachori
    replied 07/09/2020 04:14

    I think these label of field is written by you in template of email action.

    Ex: You might have written like this:

    Please explain why you want to be a member of this commission: [token of this field to render its value]


    Reply
Add an Answer