Select box from object lists
Closed this issue · 4 comments
What would you like to be added?
Hello Marcus and Obsidian Projects team
Frist, I would like give you my congratulations for the amazing work that you are doing, your plugins it's improving my life 😄.
Additionally it would like present my ideas of implement select boxes in table views as have Notion.
In the notes YAML metadata where the table is taking the data we could have something like this:
Selectbox_name_field:
- option 1 : "value1"
- option 2 : "value2"
- option 3 : "value 3"
The difference with the tags it's while tags it's an string array, select box could be a object array based on key-value.
For other views (Kanvan or calendar), could see as the default selected option.
Additionally for the system know what is the selected default option, the app could read / generate an additional metadata variable with the prefix "Selected":
Selected_Selectbox_name_field: "value 1"
I hope give you inspiration .
Why is this needed?
I have a project for content creation.
Each content, depends of a couple of variables and each variable it's one of multiple options.
For example: Now I'm solving creating a string array like this
Content platform: "Youtube, Post, Instagram, Tiktok"
And I remove the unnecessary options. But it's more manual and annoying delete the exceded options instead have a selectbox in the table index of files.
Here I put a sample for my current table of notion (that I'm migrating to obsidian).
I hope that my idea help to improve your plugin.
Thank for your time reading this.
Best regards.
Nando Lopez
One additional / better idea of YAML version
select_name_field:
- selected: "value 1"
- options: ["value 1", "value 2", "value 3"]
If the system sees "selected_" prefix in key, and the object contains "selected" and "option", the view shows a select box. It's more complex that the first idea but more clean, less writing, easy to interpretation...
One additional / better idea of YAML version
select_name_field:
- selected: "value 1"
- options: ["value 1", "value 2", "value 3"]
If the system sees "selected_" prefix in key, and the object contains "selected" and "option", the view shows a select box. It's more complex that the first idea but more clean, less writing,
I definitely see the value of something like this, and it's something I'd like to add at some point.
The question is where the list of valid options should go. Let's say that you have 20 notes with the same field. If we put the valid options in the front matter, you end up duplicating them for every note.
Another issue with keeping it in the front matter is that we'd need to define a custom format (as you've proposed). One of the design principles with the plugin is to not create new configuration formats, but rather reuse existing ones. And it would only work with the front matter data source, so we'd need to reimplement it for Dataview projects.
I'm leaning towards treating this as visual aid, rather than a data issue. In other words, the current value would still be in the note, but the list of valid options would be persisted in the plugin configuration. Benefits would be that it would work regardless of where the data comes from, and you'd update the options for all the notes in the same place.
Closing as duplicate of #221.