marcusolsson / obsidian-projects

Plain text project planning in Obsidian
Apache License 2.0
1.43k stars 58 forks source link

Select Files Based on Metadata Field Presence/Value #567

Open jeetsukumaran opened 1 year ago

jeetsukumaran commented 1 year ago

What would you like to be added?

We can currently select files for a project based on folder, tags, and/or dataview query, with a dataview query being restricted to read-only for reasons presented here: https://github.com/marcusolsson/obsidian-projects/discussions/378.

It would be very useful to be able to select/filter files based on a dataview field in much the same way we can with tags. Support for this can be very simple to avoid issues raised in the previous link. User would specify a field name (e.g., "project-category") and an optional value. Query would be run by Obsidian Projects to select the files, and after that it would be exactly as if the files were selected with, for e.g., a tag.

Why is this needed?

There many places where metadata is better to express some information and resurface it rather than tags. Some of this information can be very useful to filter files for a project. While we can add the tag data to pull it into Projects, this involves manual syncing and is fragile.

Apologies if this has been raised/considered before, and appreciate any consideration now if not. Thanks for a great plugin :)

marcusolsson commented 1 year ago

I'm not a Dataview guru, but it feels like you'd be able to replicate this using a Dataview query, no?

jeetsukumaran commented 1 year ago

I'm not a Dataview guru, but it feels like you'd be able to replicate this using a Dataview query, no?

Absolutely, but then it is a non-editable project.

I apologize -- I guess I should clarify that the FR was to support editable projects with files selected via a simple metadata field (as opposed to dataview query), with the hope that this selection mechanism would not have any of the issues of a full arbitrary query as is currently the case.

marcusolsson commented 1 year ago

Gotcha! Since this feature would be removed once we figure out how to make Dataview projects editable, I'm thinking we can hold off on this for now. Especially since you can't edit inline fields either way.

jeetsukumaran commented 1 year ago

Got it. I was hoping it could a single field would be simple enough to be handled like a tag search, maybe even not going through dataview. But as I have ZERO idea what goes under the hood here, I trust your judgement on this, and either way, thank you so much the continued time you put into such a useful and important tool ! :)