Open ekbl1 opened 6 months ago
Hello @ekbl1!
It seems an enhancement for the use case is on the way. I still wanted to share what I use just in case it's better for you, or others, in the meantime!
I use the fileLink
function to build the link instead of creating the string myself:
dv.pagePaths('"000_LifeOS/002_Data"').map(path=>dv.fileLink(path))
It applies the filename as alias by default, but you could use your own with something like this:
dv.pagePaths('"000_LifeOS/002_Data"').map(path=>dv.fileLink(path,0,dv.page(path).aliases))
Is your feature request related to a problem? Please describe.
Hi, I'd like to create a form field "Related Data" and be able to multiselect-add data that is links to notes, using a Dataview query like so:![image](https://github.com/danielo515/obsidian-modal-form/assets/115596189/6c3c3e52-6099-473e-bae5-368e071c8749)
The dataview query I am using does work in the Form Builder:
dv.pages('"000_LifeOS/002_Data"').map(page=>page.file.link).sort()
I have WikiLinks enabled and the query above gives output like so in the Form Builder:![image](https://github.com/danielo515/obsidian-modal-form/assets/115596189/7a23483d-1a8c-4cae-b165-c1a679b8e1ec)
But, the links do not show up in either the Form Preview or Rendered Form, when I try to fill out the form at this field.
In Form Preview and Rendered Form, "Related Data" is just an empty text box, even after I click into it. There is no drop down with links to select to add data to my multiselect field.![image](https://github.com/danielo515/obsidian-modal-form/assets/115596189/9f1da896-c981-49d7-ad4d-4fe026f5d7f1)
Note: I have also used the following dataview query, which creates a list I can select from of what looks like the entire text string of a WikiLink:
dv.pagePaths('"000_LifeOS/002_Data"').map(path=>"\[\["+ path + "|" + dv.page(path).file.name + "\]\]")
This solution works to add links to a file's frontmatter property, but is messy during query writing and selection from the dropdown, imho. Please test it to see what I mean. The query could be more elegant with the page.file.link dataview property. And the modal form experience of selecting from the dropdown list doesn't show the links with the full file path on hover, as would be nice. Instead the modal form has you select the entire text of a wikilink from a list.
Describe the solution you'd like I'd like for the Modal Form to show a list of hyperlinked wikilinks to notes in the Form Preview and Rendered Form in a multiselect field, when using either query, above, but particularly when using the page.file.link property in a dataview query.
Additional context
Thank you for this plugin! It's wonderful. I am so excited about it.