Replies: 4 comments 3 replies
-
Can you share your form too? Export it to JSON in the form manaager and paste it here just like you did with your template |
Beta Was this translation helpful? Give feedback.
-
I just run your template using the example form like this: ---
created: 2025-01-01
habit-class: habit
tracking: true
<%*
const result = await MF.exampleForm();
tR += result.asFrontmatterString();
-%>
---
<%* let filename = tp.file.title
if ( filename.startsWith("Untitled") ) {
await tp.file.rename(result.get("dateOfBirth"));
await tp.file.move("Wellbeing/Habit/" + result.get("Date"));
}
-%>
**Date**: <% result.getValue('dateOfBirth') %>
**Status**: <% result.getValue('habit_status') %>
**Comments**: <% result.getValue('Comments') %> And this is what I get as outcome: ---
created: 2025-01-01
habit-class: habit
tracking: true
name: bor
age: 22
dateOfBirth: 2025-12-31
is_family: false
best_fried:
favorite_meal: pizza
profile_picture:
pdf:
---
**Date**: 2025-12-31
**Status**:
**Comments**: Doesn't that follow the format you want? |
Beta Was this translation helpful? Give feedback.
-
Ok, I just saw you want a different format for the Date in the markdown, that is easy to achieve using the mapping function that
For the status, assuming you are using a select field |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help! Unfortunately, I just went in to get the information I needed but I accidentally deleted the form and can't recover it :( I need to recreate the form (I had added more fields, conditional logic etc.) and then start playing again. When I do, do you know if a conditional query will work in a template, or will this run into the same frontmatter limitations as templater (i.e. the template hasn't been created yet, so the field ends up blank)? |
Beta Was this translation helpful? Give feedback.
-
I have just started playing with this, and it is great! However, I'm having trouble figuring out two issues and am hoping the community can help:
Form Settings
This form is a habit tracker / mood tracker. The form has a date field called 'Date' that tracks the habits/mood of a particular day (can change to habit_date etc if the issue is my naming convention). I would like it so that when the form modal is triggered, it had an empty field for the date, and I was hoping to make it default to the current date that I can then override if needed (the goal is to input the day off, but I will inevitably need to do catchup entries).
It would be great if instead of dd/mm/yyyy it had the current date, e.g. 12/01/2025
Controlling 'result.getValue' output
Below is my very basic template that draws from the form. However, for the life of me I cannot figure out how to properly render the result.getValue output. I've looked at the documentation and I can see a couple of examples, but not what I need.
The two elements I'm trying to control are:
Beta Was this translation helpful? Give feedback.
All reactions