Omitting Blank Form Inputs

Hello everyone,

I am looking for a way to remove blank inputs if I have not filled them out. My snippet is structured like the following:

Facility: {formtext: name=Facility}
Department: {formtext: name=Department}

What's the best way for me to completely remove the entire like if I do not fill out the form (if I leave Department blank for example). If that is currently possible with the current setup.

Thanks in advance for any tips anyone can offer!

Here you go :slight_smile:

{note}{formtext: name=Facility}
{endnote: trim=right}
{if: Facility <> ""}Facility: {=Facility}
{endif: trim=right}
{note}{formtext: name=Department}
{endnote: trim=right}
{if: Department <> ""}Department: {=Department}

Here's the explanation of how that works:

  1. I'm putting each of the {formtext} commands in a note, so that their output never shows.
  2. I'm using an {if} command to check whether the formtext field has been filled or not
  3. If the field is not empty, I show the text and the variable.

Let me know if anything needs further clarification.

This is fantastic! The note command was the missing piece.

Thanks so much!

1 Like