Considering that daily notes name has the format 2021-11-23, the following snippet lists tasks from previous daily notes and future 3 days, excluding the current day.
Sure !
The first line is the header, like Paper, Title, Year etc…
All my files are in the folder Zettelkasten.
The line "[[" + b.file.name + "|" + (b.file.aliases[1] || b.file.aliases[0]) + "]]", means to create a link for the first column, you can skip it.
The lines
Howdy again @dryice ! Sorry for the delay - holidays and all.
Let’s see if I can help! I’ll paste the first code block below, but first, a disclaimer - you should never, EVER, blindly paste code into dataviewjs if you don’t understand it. Bad actors could utilize it to wreak havoc on your system. This isn’t that but good practice moving forward
You might want to read the MetaEdit docs to understand a little more thoroughly, but the ‘FIELD’ is the DataView/YAML field that you want to update (for instance, ‘completion-date’ is a YAML field on my Task notes.
Hopefully the code block above helps, but if it doesn’t, please let me know! I’m not sure I quite understand the issue you might be having here.
Is there anyone who know how to embed the results from dataviewjs?
```dataviewjs
let pages = dv.pages("#math").where(b => b.difficulty >= 1);
for (let group of pages.groupBy(b => b.material)) {
dv.header(group.key);
dv.list(group.rows.file.link);
}
Now, I got the list of links to the files.
file1
file2
file3
What I want to get is like these
![[file1]]
![[file2]]
![[file3]]
Thnak you in advance.
To make this work, each daily journal entry needs frontmatter that looks like this:
---
habits:
habit_1:
habit_2:
habit_3:
---
To use this frontmatter everyday, you can enable the Templates core plugin in Settings > Core plugins > Templates.
Then go to the options in Settings > Plugin options > Templates, and choose your folder location. In that folder, create a file called Daily_note where you will add the above frontmatter.
Then in Settings > Plugin options > Daily notes, update your Template File Location to the above your_template_folder/Daily_note.md. Now whenever you create a daily note, it will contain that frontmatter.
To see the table view of all your habits like in the first image, you can copy this snippet. You need to get the raw snippet, so if you’re not familiar with how that works, just use this link
In that snippet, the first section tells you what you need to change in order to match your system. Most important, habit_names have to match the exact names of the habits in your frontmatter. And daily_journal_loc needs to point to the folder where your journals are located.
Appears for a few seconds and then disappears again. I’m wondering whether there’s a bug. I had a look through the forum and noticed this thread that raised there was an issue with the Obsidian Plugin API not rendering embeddings… could this be the issue?
I wondered whether maybe the image size was an issue so I tried reducing the image size with the 200
Can someone help with this ‘Birthday’ issue please. It used to render the age in whole years of a person on their next birthday, along with their birthDate. Recently however, the age began rendering up to 14 decimal points – odd.
Hi,
I am new to Obsidian and I really find dataview to be very helpful. Even more so with js added to it. I am however not the strongest coder so I run into a bit of an issue.
What I want to achieve is a list of all my tasks on all pages sorted by the first tag in each task. All my tasks starts with a tag.
So I started with listing all not completed task.
Part two is a bit more tricky, I have found.
I have managed to make it a single list(without headings) but I think that it is due to either a bug or something I dont understand. And it is not sorted by the tag.
This is the code for that(dataview obviously):
TASK WHERE !completed GROUP BY file.tag
If i add an “s”(file.tags) to the last part of this query it will list all tasks in same file with Tags as heading.
Tags in task text aren’t parsed as tags. They’re just content (obsidian-tasks understands tags in the context of tasks, but dataviewdoes not and Obsidian does not). The tags you see in the latter example are the file’s tags, not the tags attached to the task. Since the tag is at the beginning of the text, what you actually want is to sort alphabetically. You can accomplish that with this:
// 1. Let's gather all relevant pages
const pages =
dv.pages('"_tmp/20210922 test for sumant28/Life"')
.filter(page => page.file.name.includes("test note"));
// 2. Now let's transform from thing per date (we have single page for each date) into thing per purchase (we want to have as many rows in a table as all purchases extracted from all pages)
const purchases = [];
pages.forEach(page => {
page.purchases.forEach(purchase => {
purchases.push({
file: page.file,
date: page.date,
store: purchase.store,
item: purchase.item,
comments: purchase.comments,
});
});
});
// 3. Let's sort it by date, newest first (note "-" before "purchase.date")
purchases.sort(purchase => -purchase.date);
// 4. And let's print a table of those purchases
dv.table(
[
"File",
"store",
"item",
],
purchases.map(purchase => [
purchase.file.link,
purchase.store,
purchase.item,
])
);
I had logged dozens of entries making the resulting table too unwieldy. I already have pages set up for each store in Obsidian which is a file link in the table using this syntax “[[store]]”. I want to display a filtered DataviewJS with purchases only from that store that goes on the bottom of every store file in my vault. I figured out how to filter the table using an extra int field called rating but I want to filter instead based on the .includes function but whenever I try to do this I get the error message saying purchases.store.includes is not a function.
So, just to clarify. Each week you go into the dataview table and fill in the var start and var end dates manually correct?
On each of my daily pages I have a link to the weekly page that it belongs in. Is there a way to use weekly link to pull the corresponding daily pages? That would make it more automated for me.
Also, is there a way to add a progress bar into a dataviewJS table? I have a book reading progress bar formatted like this
I am just exploring the possibility to send a note as a email. I am just using a simple URL scheme to generate the connection btw Obsidian and my mail app. subject is generated smoothly in the block below, and i could generate recipients (through a user prompt) easily.
The tricky bit is the email body and more specifically:
The call method for the note content (i am trying dv.io.load which works but embarks metadata & everything). Is there a slicker way to call the note’s content?
URL encode the note’s content. Is there a quick way to do so or is it a series of .replace()?