3-state option for Yes/No please

On this forum you can see a list of new features requested by users and you can also cast your own vote (you need to login to vote).
Post Reply
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

3-state option for Yes/No please

Post by JonP »

In every database I've worked with, there is an option for 2-state or 3-state boolean, with the 3rd state being not selected. I would like to have that option in AIM.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
rocketman
Posts: 1239
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: 3-state option for Yes/No please

Post by rocketman »

Surely this is already there? Yes No and undefined. When you create a form for searching which includes a yes/no attribute, the drop down presents yo with three options, yes, no and nothing (or as I call it "I don't care")

I just fell foul of this when I put a search together "if Yes/no attribute <> No" found all the Yes's AND all the undefined

If you want a yes/no/don't know scenario - just use a plain text attribute with a choice list of your three options and then use radio buttons in the presentation
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: 3-state option for Yes/No please

Post by PointsWell »

The null value of Yes/No can be problematic but for different reasons to your testing.

Code: Select all

if Yes/No attribute <> ‘No’
This is only testing if the attribute does not equal one state: NOT zero

1 is NOT zero, but NULL is also NOT zero.

If you want to search for Yes values and you allow NULL as a response option then you have to be explicit in that Yes/No attribute = ‘Yes’

I have found that searching for No can be problematic (for reasons that I can’t remember at the moment ) but it has required me to set the preferred default value to overcome.

UPDATE - Obviously once you set the Yes/No you lose the opportunity for NULL, that is to say, without running a process to set Yes/No to UNDEFINED, you can never change Yes to NULL only to No.
Post Reply