> [!column|flex no-title] >> [!menu-dark-red|ttl-c] [[Obsidian TTRPG Tutorials]] / [[Plugin Tutorials]] / [[Dataview]] / [[DataviewJS - Progress Bar on Tasks]] > [!column|4 no-title] >> [!menu-green-1|ttl-c] [[Getting Started]] > >> [!menu-green-2|ttl-c] [[Plugin Tutorials]] > >> [!menu-green-3|ttl-c] [[Community Supported Games]] > >> [!menu-green-4|ttl-c] [[Obsidian TTRPG Tutorials/Templates/Templates\|Templates]] > [!column|3 no-title] >> [!patreon|ttl-c] [Patreon](https://www.patreon.com/JPlunkett) ([Starter Vault](https://www.patreon.com/posts/obsidian-patreon-96801399)) > >> [!discord|ttl-c] [Obsidian TTRPG Community Discord](https://discord.gg/CdM9UCJdwU) > >> [!discord|ttl-c] [Obsidian Official Discord](https://discord.gg/8AF29UBUCa) You can add a status bar to your notes that tracks progress of checkboxes within your current note. ![[Obsidian_AaMCSaPjqL.gif]] Copy the code below into a note. Update the 2x `"Test"`. Change these to `"YourNoteName"` ```` ```dataviewjs (await dv.tryQuery('TASK FROM "Test" ')).values.length const Tasks = dv.page("Test").file.tasks let CompletedTasks = Tasks .where(t => t.completed) dv.span( "![progress](https://progress-bar.dev/" + parseInt((CompletedTasks.length / Tasks.length) * 100) + "/)" ) ``` - [ ] Quest 1 - [ ] Quest 2 - [ ] Quest 3 - [ ] Quest 4 - [ ] Quest 5 ```` Here is a variant: ![[Obsidian_qRU5Pc9IwV.gif]] ```` `$= const value = Math.round(((dv.current().file.tasks.where(t => t.completed).length) / (dv.current().file.tasks).length || 0) * 100); "<progress value='" + value + "' max='100'></progress>" + " " + value + "%"` - [ ] Quest 1 - [ ] Quest 2 - [ ] Quest 3 - [ ] Quest 4 - [ ] Quest 5 ````