Advanced query/scripting to automatically pull the latest reference date as an input in a page property?

Is there a way to have this property field I made, “last-contact” autopopulate with the last reference entry’s date? e.g. in this example, the date November 21, 2023?

To explain with an example, imagine I have a page called Melinda. I have a template I insert into the Melinda page where the page property field “last-contact” is inserted in. I have a separate daily journal entry I made for Melinda on my daily journal page on 12/15/2023 so the last-contact field will automatically update the last-contact date with 12/15/2023.

Two weeks later, I do another call with Melinda on 1/1/2024 and link it to the Melinda page (the entry was made in the daily journal page). The template last-contact that was inserted two weeks ago must dynamically update without any input/refresh from me that the last contact date was now 1/1/2024 not 12/15/2023 when the template was inserted.

Is there a way to make this happen? Right now I’m having to manually after logging a new journal entry go to each page and manually update the last-contact date with the newest journal entry date which is very very tedious.

Welcome. Could be possible to use a query for pulling the latest reference (dates are currently problematic). But for dynamically updating a property, scripting is needed.

is there an easy way to build a script like this or an example/tutorial I can find or is this very complicated?

  • It is certainly advanced.
    • Though not difficult.
  • Then it depends on your familiarity with scripting in general.
    • And in this case with javascript in particular.
  • Logseq’s API supports both:
    • querying
    • updating
  • You could save some initial effort by using kits.
    • Check the links there for real-life examples.
  • Can always return here with specific questions.

oh boy unfortunately i dont know javascript at all. I guess I can’t really do this then.

@axp0999 You can achieve what you want with 🏛 Full House Templates plugin.


2024-01-03 04.24.54

Just created a separate topic for this case.