Skip to content
Discussion options

You must be logged in to vote

@ZangXincz You can extract todo items from Trilium using the backend script API. Todo checkboxes are stored as HTML with a specific structure:

<ul class="todo-list">
  <li>
    <label class="todo-list__label">
      <input type="checkbox" disabled="disabled"> <!-- unchecked -->
      <span class="todo-list__label__description">Task text</span>
    </label>
  </li>
</ul>

Here's a backend script example to extract all unchecked todos under a root note:

// Create as a code note, run manually or with #run=backendStartup
const notes = api.searchForNotes('note.type = "text" AND ancestors.noteId = "YOUR_ROOT_NOTE_ID"');

const todos = [];

for (const note of notes) {
    const content = note.ge…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Comment options

You must be logged in to vote
1 reply
@ZangXincz
Comment options

Answer selected by eliandoran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
State: Triage Issues that need to be verified scripting
1 participant
Converted from issue

This discussion was converted from issue #9216 on March 28, 2026 09:44.