Hello.
I have a list of my current projects at the index page, like:
Customer:: [[001-HH-1]]
Order::
Status::
Comments::
Is it possible to autofill Order and Status from the note [[001-HH-1]]?
Inside [[001-HH-1]] I have many fields including but not limited to:
Name
Phone
Order
Status
What I want to achieve at the index page:
Customer:: [[001-HH-1]] (I add the linked note)
Order:: autofill from the linked note
Status:: autofill from the linked note
Comments:: I type it manually and then move it to the note or just delete
Things I have tried
I did try to make a list or table of all the notes in the folder Customers by Status -[/] but I can’t edit it at the index page (Comments)
Here is a simple variant using the Templater plugin, where it prompts for the customer, and then inserts the various fields only if that customer note exists:
<%*
const dv = app.plugins.plugins.dataview.api
let page
const customer = await tp.system.prompt("Enter customer")
if ( customer ) {
page = dv.page(customer)
} else {
tR = `==Please enter the name of a valid customer note==`
}
if (!page) {
tR = `==Not a valid customer (${ customer })==`
} else {
/* We now got a valid page (hopefully) to pull values from */
_%>
Customer:: [[<% customer %>]]
Order:: <% page.Order %>
Status:: <% page.Status %>
Comment:: <% tp.file.cursor() %>
<%* } /* End of if (!page) {} else statement */ _%>
Put the code above in a Templater template file, and either assign a hotkey to it, or insert using the Templater: Insert template modal command, or some other means if you feel more like that.
If needed, you could potentially also do a dataview query in front of (or instead of the prompt), and use tp.system.suggester() to choose from your existing customers.