Check box to hide or show a record; not delete a record

amheng5 10 Mar, 2019
I've tried to search for this but can't seem to find an answer. Is it possible to have a check box function to hide or show a record? I don't want to actually delete a record. Thanks
amheng5 10 Mar, 2019
I decided to make a radio group "Show" or "Hide" in my CF6 form.

Now I can't figure out in CC6 the correct syntax for "Where Condition" for my Fn Read Data to only list those records that have "Show" entered in CF6 Radio group and view CC6 in Table view.

Any suggestions?
amheng5 10 Mar, 2019
My syntax for the filtering settings:

model.show_hide_record/LIKE:%Show%

AND

model.comments/LIKE:%{data:keywords}%

I only want to show list of records with "Show" in the show_hide_record field as well as any word entered in the search field; however records even with show_hide_record field empty appear.

Where am I going wrong?
healyhatman 10 Mar, 2019
Your show_hide_record should be either 1 (show) or 0 (hide). The database field should be BOOLEAN but you can leave it as if you like.

I would recommend AGAINST using "Show" and "Hide".

If you really want to keep it as "Show" "Hide" then it should be
model.show_hide_record:Show
not /LIKE:%x%
amheng5 10 Mar, 2019
Why

"I would recommend AGAINST using "Show" and "Hide"."

Just curious.
healyhatman 10 Mar, 2019
Answer
Well if it's going to be either/or, a boolean is a lot more efficient. It's also easier to perform checks on.
if(show_or_hide)
versus
if(strtolower(show_or_hide) == "show")
amheng5 10 Mar, 2019
Thanks for the explanation. I'll change to your suggestion.

here's my new filtering settings:
model.show_hide_record:1
AND
(
model.birth_year/LIKE:%{data:keywords}%
OR
model.comments/LIKE:%{data:keywords}%
)
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger