danielo515 / obsidian-modal-form

Define forms for filling data that you will be able to open from anywhere you can run JS
https://danielorodriguez.com/obsidian-modal-form/
MIT License
199 stars 17 forks source link

Feature Request: Enhanced Integration with Dataview Functions #304

Closed Z4rko963 closed 2 months ago

Z4rko963 commented 2 months ago

Hi,

First, I'd like to thank you for the excellent Modal Forms plugin. It has been incredibly useful for my workflows in Obsidian.

I have a suggestion for a new feature that would greatly enhance the usability of the plugin. It would be fantastic if the plugin could support more Dataview functions, such as current, to view and select values of a specific property directly within the modal suggestor. Additionally, having an option to display results with the name of the aliases would be very useful. This feature would allow users to dynamically access and select data based on the current context or other Dataview query results, with more readable and user-friendly labels.

Thank you for considering this suggestion, and for all your hard work on the plugin!

Best regards, [Zúñiga]

danielo515 commented 2 months ago

I want to improve the options provided to dataview functions. However, there are some functions that are not possible to support, and current is one of them. dv.current points to the current file dataview is being called from, and in the context of modal-form, we don't have any file as context, and even if we do, that will probably be the templater template. Unless I am missing something, this is not possible. We have, however, provide some context from the outside to modal form. Right now, the only option is to provide default values for fields, but as suggested in #269 we can allow to have "variables". I think more and more request could benefit from this feature, so I will consider it, even with some "built-in" ones or an easy way to provide some "extras" with MF helpers. I have to think about it.

Z4rko963 commented 2 months ago

Thank you for your prompt and detailed response.I appreciate the clarification regarding the limitations of supporting the current function within the Modal Forms context. I understand the challenges associated with the absence of a specific file context and the constraints it imposes.Your consideration of introducing "variables" and additional context options is encouraging. This potential enhancement could indeed benefit many users, providing more flexibility and dynamic capabilities in using Modal Forms. Thank you for considering the use of variables to provide more context from the outside; this is an exciting possibility that could greatly enhance the plugin's functionality.I look forward to seeing how this idea develops and any future updates you might implement.Thank you once again for your hard work and dedication to improving the plugin!