Hello!!!
As requested by Philip, I write here and continue conversation on issue: https://github.com/IQSS/dataverse/issues/7961#issuecomment-1834667463
Any files in the source code, I should look at to implement "the boolean", it sounds scary ;)
This is a commit for an old Version of Dataverse 4.20, but probably most of it is still true. Line numbers are probably not correct anymore. The validator has been updated since and the test might exist, so potentially ignore that part. Still, hopefully provides some pointers. https://jugit.fz-juelich.de/fdm/dev/dataverse/-/commit/d4aece03aebcf9c2237aa7842c17c0d96af6a79a
@Asbjørn Skødt please take a look at the commit by @Oliver Bertuch above and let us know if you have any questions!
Philip Durbin sagde:
Asbjørn Skødt please take a look at the commit by Oliver Bertuch above and let us know if you have any questions!
I will look at it and get back to you!
Hello, is the name of the new datatype most appropriately "boolean" or "checkbox"?
"Boolean" is more true to the datatype in programming languages, however "checkbox" is more semantically meaningful in a website context and hence user-friendly.
I'd go with "boolean". This is deep in the system and will also be accessed via API, where there are no checkboxes, just data. :grinning:
Thx!!!
How should no value (null) be handled?
Hmm. Good question. In Java there's the idea of "optional" in order to avoid nulls. Maybe we could use that pattern?
But yeah, I think in most people minds there are actually three values: true, false, or unspecified. :thinking:
I mean, should we consider having two new data types: a true boolean vs. a nullable boolean?
@Asbjørn Skødt don't look now! A new PR! Custom metadata support boolean values #10480
Do you want to QA it for us? Or at least review it? :grinning:
Hi. If you have any questions about the PR I can answer them here or directly into it.
@Jérôme Roucou for the UI, it's a text input. Did you consider any alternatives such as radio buttons or a drop down? Something where you don't have to type? :grinning:
Checkbox?
Or a checkbox, sure.
I'd considered a checkbox too, but not being sure about the original need. So I left a simple input text field. But a checkbox can only be true or false, not null.
Well, @Asbjørn Skødt has an actual need. Maybe he can enlighten us.
Or maybe I can remember what it was. :thinking:
Interesting. scripts/api/data/metadatablocks/custom_hbgdki.tsv has a dropdown:
2c50f3a8-83d1-11e5-8ae1-85d1599278fd.png
From this issue (which I closed in favor of #7961): Metadata: Support radio buttons for Yes / No responses #2727
I just encouraged the community to take a look at the PR and this Zulip thread: https://groups.google.com/g/dataverse-community/c/9-T3jtd03tY/m/294KXvwaAQAJ
Oh thanks ! :pray: On this conversation dropdown seems to be appreciated
http://www.primefaces.org/showcase/ui/input/triStateCheckbox.xhtml?jfwid=b8c01
Also available in React: https://dev.to/gsto/how-to-build-an-indeterminate-checkbox-in-react-kbh
@Ellen K @Guillermo Portas any opinions on how a boolean input should look in React?
We have been using React Bootstrap for our basic input components (wrapping them in our design system) so I would try that first. They have a component here that we could look at https://react-bootstrap.netlify.app/docs/forms/checks-radios/
Perfect. Thanks, Ellen!
Would this help @Ellen K ? https://stackoverflow.com/a/70434396
If we want to represent a boolean that is optional, and record the difference between 'false' and null then I think a simple 2 button radio will work, right? So I don't think we need to have an a customized checkbox, unless I'm missing something
This is great!!!
Yes, for sure I want to help out. I'll take a look.
If curious, this is some code I wrote on the issue some months back, but never got around to fully deal with the nullable dilemma: https://github.com/IQSS/dataverse/commit/0862bcc4aafcb58120d4e4847626c2a7e359f804
I suggest we leave this code behind and continue focus on Jerome's PR. If I am late to responding in the future, please do not delay any QA or review on my behalf.
With regards to UI implementation, I think it should either be a dropdown or radio button approach, in order to deal with the nullability dilemma. A checkbox can, unfortunately, not properly deal with nullability (or rather a false statement), and a checkbox cannot be required.
The dropdown/radio buttons may have three value options which in the backend would equate to "True", "False" and "Null". In the UI these may be written as "Yes", "No" and "Blank" or left customizable by the metadatablock.
These are my thoughts atm. What do you think?
I think I said this in Mexico but we could have two types, if we need them:
But I don't know if we need both. :grinning:
non-nullable bool is the same as required nullable bool
For nonNullableBoolean (requiredNullableBoolean) there should be a default value.
I remember @Asbjørn Skødt 's use case: The question was "Should this dataset be archived in our archival system?" And the default value should be false.
There was an issue about having default values as part of the TSV, aye?
I'd say go for that and don't imply an implicit default, just specify it in the field
We just talked about this a bit in the frontend meeting. @Gustavo Durand pointed out that one way to set default values is with dataset templates.
But yeah, maybe it should be possible to specify a default value in the tsv.
Last updated: Nov 01 2025 at 14:11 UTC