How to only display content in a field if it contains text

By: Susan Barnes | Asked: 04/29/2025
ForumsCategory: How-toHow to only display content in a field if it contains text
Susan Barnes asked 3 weeks ago

I have a data form, search form, and view to store and then display results that match a search. One of the form fields is entitled notes and only contains text (or notes) in certain cases. Is it possible for my reviews view to only display the notes field if the field is actually contains text? I'm struggling with this in the view editor and have tried the following:

 

[if 261 equals=""]Conditional content here[/if 261]

 

I hate to be dense, but I don't know what I should replace "Conditional content here" because the notes are as varied as the entires. 

 

Thanks for considering my question!

Rob LeVineRob LeVine Staff replied 3 weeks ago

I don't know what you mean by text vs. notes. If it's a text field, it has text, regardless of what you call it. Do you have text in one field and notes in another?

Victor Font Staff replied 3 weeks ago

Maybe it would help to understand that Formidable does not save fields that are absent of values. If a note field is empty, it's not saved in the database.

Susan Barnes replied 3 weeks ago

Thanks for responding. I did not explain my problem well. My data form is a leadership directory. It contains several variables that every entry shares such as name, city, and state. In addition, one of my columns is for recording notes about entries. Not every entry has notes. I want users to be able to query or search for information and see those results in my grid view. But, it looks a bit clunky to have a the "Notes" field with every search result. I would like for the "Notes" field to only appear with an entry if there are notes for that leader.

Is this possible? Thanks!

1 Answers
Rob LeVineRob LeVine Staff answered 3 weeks ago

Then what you want to is very similar to what you had in your original post. Whatever is inside the [if][/if] will be shown or not shown depending on the condition. In your case you'd want the content to include the label and the value, and if there is no value, the label won't show either. e.g., assuming 261 is the notes field [if 261 not_equal=""]Notes: [261][/if 261]

Susan Barnes replied 3 weeks ago

Thanks so much, Rob! It works beautifully. I really appreciate you taking the time to respond and provide your expertise.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right