snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Custom Field type of checkbox

Open carock96 opened this issue 8 years ago • 11 comments

Server (please complete the following information):

  • Snipe-IT Version - v4.5.0 build 3701
  • OS: [e.g. Ubuntu, CentOS] - Ubuntu 4.15.0-30-generic
  • Web Server: [e.g. Apache, IIS] - Apache
  • PHP Version 7.2.7

Instead of a BOOLEAN text box where a user has to type in the yes/no 0/1 value, it would be more error resistant to use a simple checkbox.

Another alternative for the BOOLEAN type is to have a select list instead of a blank text box.

carock96 avatar Aug 13 '18 15:08 carock96

+1

The feature is still new enough that the documentation for v3.6.2 still shows up when searching for details about custom fields - without any note about the boolean data type.

In addition to this, the error message of The <fieldname> must be true or false. that appears under the field's input box is very vague/unhelpful in that it doesn't contain any guidance that the value should be 0/1.

Perhaps one option as an intermediate solution for the confusion is that if a user enters the string "true" or "false" or "" then it gets converted behind the scenes to 0/1/null? And the same in reverse when viewing the asset listings - seeing a column of zeros and ones is less meaningful than a column of true and false values. But I do agree that a checkbox (or true/false/unset radio buttons) would be a better solution for at least the input.

MysterAitch avatar Sep 03 '18 01:09 MysterAitch

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Nov 02 '18 01:11 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

stale[bot] avatar Nov 09 '18 01:11 stale[bot]

Still an issue in 4.6.6.

image

chemnic avatar Nov 09 '18 13:11 chemnic

+1, I would love to see a checkbox as a boolean interface

cliff-LINKS avatar Jul 26 '19 08:07 cliff-LINKS

Still an issue.

pfenning-IT-OPs avatar Oct 24 '19 10:10 pfenning-IT-OPs

This would be a great addition to custom fields.

taalas avatar Oct 24 '19 14:10 taalas

I just tried making a boolean custom field and was confused that it showed a text box to fill in rather than a checkbox. The field also accepts any text, and I'd like it to be just a straight boolean, so that I can query it based on that logic using the REST API.

nspaul avatar Feb 03 '20 15:02 nspaul

This is confusing. Why isn't boolean a checkbox. A textbox that asks for a written boolean value is very odd. If I make a listbox and enter 'True' and 'False' as values, it will allow me to save the field but when I attempt to update an asset it fails and tells me that the only valid values are 'true' and 'false'. This is even more confusing.

I changed the possible list box values to 'true' and 'false' thinking that perhaps the issue was case, but it won't accept these either. It will only accept 0 and 1. I can't imagine that some logic to interpret/display True/False instead of 1/0 is that difficult or time consuming to add.

Since these values are null when the fields are added to an asset, it makes sense that I can change them back to null but this isn't straightforward either. The value in the list box has to be changed back to "Select boolean" to set the value to null. Maybe it makes more sense to set them all to false by default when a new boolean value is added to an asset.

ghost avatar Sep 17 '20 23:09 ghost

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Nov 18 '20 04:11 stale[bot]

System already can use textfields as booleans. I think I recall that when this issue was posted, the checkbox customfields weren't functioning correctly, but now they do, and I think the options that the system have about this issue are enough now. I'll try to explain myself.

Personally I believe it's a better solution than using checkboxes, because the checkboxes can be a group of different things that can be selected or not, and a boolean only can take a true or false value. For a silly example maybe, with a CustomField of type checkbox we can name the field 'Colors available' and have an array of [blue, white, silver] values and only have checked the colors that we have available for assets. Surely better examples can be thought by our users. But if the custom field have to be a boolean, a listbox made more sense, because it ONLY can take one value at a given time: true or false, which a listbox cover.

Of course that I can be wrong, and if enough users take on this issue is that they really, really need or want that a single checkbox represents a boolean field, then we can consider it again. But for now I think that the use case for this is already covered.

inietov avatar Sep 14 '22 23:09 inietov