Closed juusan closed 9 months ago
Thank you for your kind words! And for using it Sadly, there is no way yet. I've been thinking a lot about streamlining the usage of the result and the API, and this specific case was already in my mind.
As a workaround, you can currently do this:
const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('climateLogForm');
const data = result.getData()
if (data.AC_probe_T_avg){
tR += `AC_probe_T_avg :: ${AC_probe_T_avg}\n`;
}
How would it look like something like this (this is the idea I have in mind)
const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('climateLogForm');
tR += result.map('AC_probe_T_avg', (value) => `AC_probe_T_avg :: ${value}`)
Here, if the value of AC_probe_T_avg is undefined, then the map will return an empty string, but if the value exists, then it will use your function to transform it to whatever you want
Hello !
What a wonderful plugin ! Thanks for working hard on it.
Do you know if there is a way to output nothing if we submit no value into the prompt ? Here is an exemple :
With this snippet, if I enter 25 it renders like : AC_probe_T_avg :: 25 But if I let the prompt empty and submit it, it renders AC_probe_T_avg :: {{AC_probe_T_avg}} I would like to render it just like AC_probe_T_avg ::
Is there any way to do it ? Thank you so much !