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

[FR] Grab field values from dataview query #112

Closed
cogscides opened this issue Sep 28, 2022 · 7 comments
Closed

[FR] Grab field values from dataview query #112

cogscides opened this issue Sep 28, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request fileClass related to fileClass management settings related to field management in settings types related to field types

Comments

@cogscides
Copy link

Similar to what you make for assigning fileClass based on dataview query, but for collecting all values to quickly insert them in the field instead of manually entering.
Maybe in the fileClass note something like this:

personClass.md
===
profession:: { "type": "dataview", "options: "dv.pages("#person").where(p.profession)"}
@mdelobelle
Copy link
Owner

good idea, I think this is more or less the same request as #110 ?

@cogscides
Copy link
Author

@mdelobelle some kind of yeah. In my case areas are the tags. I saw that folk on Better Inline Fields plugin working on a similar way to grab values from other inline fields. Would be good to have ways to manage them without manually entering them in the fileClass object.

@mdelobelle
Copy link
Owner

ok got it, it's not the same idea indeed.

I guess I could add an option to "Select" and "Multi Select" fields settings where the user can create a dataview request that returns a list of string to would populate the select options

in your example the setting would look like

personClass.md
===
profession:: { "type": "Select", "optionsFromDVQuery": "dv.pages("#person").where(p => p.profession !== undefined).map(p => p.profession.toString())"}

even more sophisticated thing would be feasible, such as removing duplicates:

personClass.md
===
profession:: { "type": "Select", "optionsFromDVQuery": "[...new Set(dv.pages("#person").where(p => p.profession !== undefined).map(p => p.profession.toString()).sort()]"}

It's for advance usage but yeah, I think this would be usefull

Am I understanding correctly what you have in mind?

@mdelobelle mdelobelle self-assigned this Oct 1, 2022
@mdelobelle mdelobelle added fileClass related to fileClass management settings related to field management in settings types related to field types enhancement New feature or request labels Oct 1, 2022
@cogscides
Copy link
Author

Yeah, that is absolutely right what I imagined! 😍

@mdelobelle mdelobelle added this to the next release milestone Oct 4, 2022
@mdelobelle
Copy link
Owner

Hi this is now available in 0.2.9. I hope it will suit your need

@cogscides
Copy link
Author

@mdelobelle omg, you are magician! Is it possible to use dataview query from class file? Or only via the settings?

@mdelobelle
Copy link
Owner

thanks. yes it is

@mdelobelle mdelobelle removed this from the next release milestone Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fileClass related to fileClass management settings related to field management in settings types related to field types
Projects
None yet
Development

No branches or pull requests

2 participants