Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datasets: Add select and multi-select fields #8117

Open
garethrees opened this issue Jan 29, 2024 · 1 comment · May be fixed by #8397
Open

Datasets: Add select and multi-select fields #8117

garethrees opened this issue Jan 29, 2024 · 1 comment · May be fixed by #8397
Labels
enhancement Adds new functionality f:projects x:uk

Comments

@garethrees
Copy link
Member

garethrees commented Jan 29, 2024

Add select field to Dataset::Key::FORMATS

We're often getting initial question sets where the project owner wants to supply a preset list of options.

@garethrees garethrees added x:uk enhancement Adds new functionality f:projects labels Jan 29, 2024
@garethrees
Copy link
Member Author

Datasets: Add select and multi-select fields

An issue that keeps coming up with Projects is that owners want to be able to provide a list of options for contributors to pick from. At the moment the workaround is to use a plain text box or a series of Yes/No fields.

A plain text box has the limitation that contributors will inevitably enter values in different formats (different capitalisations, hyphenations, spellings, CSV, separated by line breaks, etc) and different orderings. This makes it difficult to filter by values in this field.

The other option is to use a series of Yes/No field types, but this can require breaking up the project into multiple projects so that the extraction form doesn’t get too long.

Adding a select and multi-select field type would be a relatively easy win to solve these issues and make Projects even more useful.

Frontend

We might want to refer to this as a “drop down”, since that seems to be the terminology most often used when users have asked about this.

Adding user-enterable values adds additional complexity not only in the backend but in the form builder. An idea here could be to contain any “configuration” for the field within a modal.

Screenshot 2024-08-15 at 17 09 34

This would keep the main form builder consistent in its 3 main columns (title, field type, remove button), and then reveal specific field configuration only when necessary.

We’d likely want to validate that at least two options are present.

Backend

For the current fields we only store the fields type and user entered title. For select fields we’ll also need to store the option values.

Initially we’ll limit the select field to a flat list of options – i.e. no optgroups. If its easy we could add an "allow blank" option to the "configuration", but not essential.

Submissions & Dataset Output

For single-select fields, we’ll just render the column with the value as normal.

Multi-select will mean we'll now have to deal with a multi-value field.

We’ll handle multi-select by storing the the selected values as a CSV string and render it within the single column.

other,headings,cars,boolean
foo,bar,"volvo, ford, mercedes",Yes

We’ll need to think about where this could break, and limit the format of the options accordingly.

@garethrees garethrees changed the title Add select field to Dataset::Key::FORMATS Projects: Select Field Sep 16, 2024
@garethrees garethrees changed the title Projects: Select Field Datasets: Add select and multi-select fields Sep 16, 2024
gbp added a commit that referenced this issue Sep 30, 2024
Allow project owners to add questions with a pre set list of options
which can be selected when extracting information from requests.

There are also options to allow blank value or multiple values, these
effect how the form select input is rendered in the extracting sidebar.

Fixes #8117
gbp added a commit that referenced this issue Sep 30, 2024
Allow project owners to add questions with a pre set list of options
which can be selected when extracting information from requests.

There are also options to allow blank value or multiple values, these
effect how the form select input is rendered in the extracting sidebar.

Fixes #8117
@gbp gbp linked a pull request Sep 30, 2024 that will close this issue
gbp added a commit that referenced this issue Sep 30, 2024
Allow project owners to add questions with a pre set list of options
which can be selected when extracting information from requests.

There are also options to allow blank value or multiple values, these
effect how the form select input is rendered in the extracting sidebar.

Fixes #8117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds new functionality f:projects x:uk
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant